Skip to content

Conversation

AbhijeetRanjan308
Copy link
Contributor

@AbhijeetRanjan308 AbhijeetRanjan308 commented Jun 17, 2025

Summary

  • Migrated Prefix ALK with KMChat

Testing Branches

KM_ChatUI_Branch : CM-2442
KM_Core_Branch: dev

Summary by CodeRabbit

  • Refactor
    • Migrated various classes and methods to use updated KMCore and KMChat types, replacing legacy AL/ALK types throughout the chat and conversation modules.
Copy link

coderabbitai bot commented Jun 17, 2025

Caution

Review failed

Failed to post review comments.

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 29ed7ad and 9f0ddb2.

📒 Files selected for processing (22)
  • Example/Tests/ConversationVCNavBarSnapshotTests.swift (1 hunks)
  • Example/Tests/KMConversationViewControllerTests.swift (2 hunks)
  • Example/Tests/KommunicateTests.swift (1 hunks)
  • Example/Tests/Mocks/ConversationDetailMock.swift (1 hunks)
  • Sources/Kommunicate/Classes/ConversationDetail.swift (4 hunks)
  • Sources/Kommunicate/Classes/ConversationVCNavBar.swift (3 hunks)
  • Sources/Kommunicate/Classes/Extensions/KMConfiguration+Extension.swift (1 hunks)
  • Sources/Kommunicate/Classes/FaqViewController.swift (1 hunks)
  • Sources/Kommunicate/Classes/KMAppSettingsService.swift (3 hunks)
  • Sources/Kommunicate/Classes/KMBotService.swift (1 hunks)
  • Sources/Kommunicate/Classes/KMConversationDetail.swift (1 hunks)
  • Sources/Kommunicate/Classes/KMConversationListViewController.swift (20 hunks)
  • Sources/Kommunicate/Classes/KMConversationService.swift (9 hunks)
  • Sources/Kommunicate/Classes/KMConversationViewController.swift (14 hunks)
  • Sources/Kommunicate/Classes/KMPushNotificationHelper.swift (5 hunks)
  • Sources/Kommunicate/Classes/Kommunicate.swift (17 hunks)
  • Sources/Kommunicate/Classes/MessageCharacterLimitManager.swift (1 hunks)
  • Sources/Kommunicate/Classes/Models/ChatMessage.swift (2 hunks)
  • Sources/Kommunicate/Classes/Models/KMMessageBuilder.swift (1 hunks)
  • Sources/Kommunicate/Classes/PricingPlan.swift (2 hunks)
  • Sources/Kommunicate/Classes/Views/FeedbackRatingView.swift (1 hunks)
  • Sources/Kommunicate/Classes/Views/KMFiveStarView.swift (1 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (2)
Example/Tests/Mocks/ConversationDetailMock.swift (1)
Sources/Kommunicate/Classes/ConversationDetail.swift (1)
  • updatedAssigneeDetails (44-65)
Sources/Kommunicate/Classes/KMBotService.swift (1)
Sources/Kommunicate/Classes/ConversationDetail.swift (1)
  • conversationAssignee (17-42)
🪛 SwiftLint (0.57.0)
Example/Tests/KMConversationViewControllerTests.swift

[Warning] 21-21: Initializers declared in compiler protocol ExpressibleByIntegerLiteral shouldn't be called directly

(compiler_protocol_init)

Sources/Kommunicate/Classes/Kommunicate.swift

[Error] 1324-1324: Force casts should be avoided

(force_cast)

⏰ Context from checks skipped due to timeout of 90000ms (2)
  • GitHub Check: Build and Lint
  • GitHub Check: Build and Test
🔇 Additional comments (20)
Sources/Kommunicate/Classes/KMConversationDetail.swift (1)

53-57: Superclass swap looks fine, but double-check runtime availability.

KMGroupUser now inherits from KMCoreGroupUser.
Compilation will succeed as long as KMCoreGroupUser is available on every target (main app + extensions + test bundles). Swift won’t catch missing symbols until runtime when the framework is loaded, so please run unit/UI tests on all targets after this rename.
Nothing else to flag here.

Example/Tests/KommunicateTests.swift (1)

40-44: Good migration to KMCoreMessage.

Instantiation updated correctly and the required import is already present. No other changes needed in this block.

Sources/Kommunicate/Classes/Extensions/KMConfiguration+Extension.swift (1)

11-11: Extension target renamed – verify symbol exposure.

Changing the extension receiver to KMChatConfiguration compiles only if the symbol is public in KommunicateChatUI_iOS_SDK. Make sure the access level wasn’t internal in the pod; otherwise these helpers will be invisible to clients.

Sources/Kommunicate/Classes/MessageCharacterLimitManager.swift (1)

27-41: Confirm new KMChatChatBar API parity

chatBar.addTextView(delegate:) and chatBar.disableSendButton(isSendButtonDisabled:) were originally defined on ALKChatBar.
If KMChatChatBar hasn’t kept these exact selectors or kept them with identical parameter labels, this will break at compile-time. Please run the compiler or grep for the new signatures to ensure they still exist.

Sources/Kommunicate/Classes/KMBotService.swift (1)

13-20: Service swap looks good – verify downstream methods exist

KMCoreChannelService/KMCoreChannelDBService replace the AL* variants. All later calls (getChannelByKey, loadChannelUserX) must still be present on the new types. A quick search will confirm.

Example/Tests/ConversationVCNavBarSnapshotTests.swift (1)

25-27: Type migration accepted

KMCoreChannel substitute compiles cleanly here; no further changes needed.

Sources/Kommunicate/Classes/KMAppSettingsService.swift (1)

112-114: LGTM – renamed appearance proxy is correct

UINavigationBar.appearance(whenContainedInInstancesOf:) now targets KMChatBaseNavigationViewController, matching the new class prefix. Nothing else to flag here.

Example/Tests/Mocks/ConversationDetailMock.swift (1)

16-19: Signature update is consistent with production code

The mock now mirrors the production method’s new (ALContact?, KMCoreChannel?) completion signature, keeping the tests compiling.

Sources/Kommunicate/Classes/Models/ChatMessage.swift (1)

12-34: Migration looks correct

ChatMessage now conforms to KMChatChatViewModelProtocol and the initializer mirrors the new protocol. No functional or stylistic issues spotted.

Sources/Kommunicate/Classes/PricingPlan.swift (1)

22-57: LGTM! Good refactoring for improved readability.

The addition of trialPlan and churnedPlan constants follows the existing pattern, and the refactoring of showSuspensionScreen() method improves code clarity by extracting the plan check into a descriptive boolean variable.

Sources/Kommunicate/Classes/ConversationVCNavBar.swift (1)

153-312: Consistent migration to KMCore types.

All ALChannel references have been properly replaced with KMCoreChannel, and the bundle reference has been updated to use the new KMChatConversationListViewController class. These changes align with the broader SDK migration.

Sources/Kommunicate/Classes/ConversationDetail.swift (1)

12-116: Service classes properly migrated to KMCore.

All AL-prefixed services and types have been consistently replaced with their KMCore equivalents:

  • ALChannelServiceKMCoreChannelService
  • ALChannelDBServiceKMCoreChannelDBService
  • ALChannelKMCoreChannel

The extension migration is also correct.

Sources/Kommunicate/Classes/KMPushNotificationHelper.swift (1)

15-108: Configuration and type migrations completed successfully.

All legacy AL/ALK types have been properly migrated:

  • ALKConfigurationKMChatConfiguration
  • ALMessageKMCoreMessage
  • ALChannelServiceKMCoreChannelService
  • ALKBaseNavigationViewControllerKMChatBaseNavigationViewController

Documentation has been updated accordingly.

Sources/Kommunicate/Classes/KMConversationViewController.swift (4)

14-14: Class inheritance properly migrated.

The class now correctly inherits from KMChatConversationViewController instead of ALKConversationViewController.


23-196: Message type migrations completed.

All ALMessage references have been properly replaced with KMCoreMessage throughout the message handling logic.


116-116: ```shell
#!/bin/bash

Locate the KMCoreChannelService file

fd KMCoreChannelService.swift

Search for any occurrence of isChannelDeleted in Swift files

rg -n "isChannelDeleted" --type swift

 --- `830-831`: ```shell #!/bin/bash # Determine iOS deployment target for the project project_pbx=$(find . -type f -name "*.pbxproj" | head -n1) echo "Project pbxproj: $project_pbx" grep -R "IPHONEOS_DEPLOYMENT_TARGET" -n "$project_pbx" 
Sources/Kommunicate/Classes/KMConversationListViewController.swift (1)

12-859: Comprehensive migration from ALK to KMChat prefixes completed successfully.

All type replacements in this file are consistent with the PR objectives. The migration includes:

  • Class inheritance updated to KMChatBaseViewController
  • Properties migrated to use KMChat/KMCore prefixed types
  • Method signatures updated with new parameter types
  • Notification names using new constants
  • Delegate protocols renamed appropriately

The changes maintain the same functionality while aligning with the new naming convention.

Sources/Kommunicate/Classes/Kommunicate.swift (2)

30-36: Type aliases updated correctly to new KMChat/KMCore types.

All public type aliases have been properly migrated to maintain backward compatibility while using the new underlying types.


684-1658: Service classes and remaining components migrated successfully.

All service class updates and component migrations are consistent:

  • Channel and message services updated to KMCore prefix
  • Configuration parameters use KMChatConfiguration
  • Navigation components reference KMChatBaseNavigationViewController
  • Cache cleared using KMChatFormDataCache

The migration maintains functional equivalence while adopting the new naming scheme.

Walkthrough

This change refactors the codebase to replace legacy AL/ALK-prefixed classes, protocols, and services with their KMCore/KMChat-prefixed counterparts throughout the Kommunicate SDK. The update affects controllers, models, services, extensions, tests, and configuration types, aligning the code with a new core architecture. No significant control flow or logic changes are introduced.

Changes

File(s) Change Summary
Sources/Kommunicate/Classes/Kommunicate.swift
Sources/Kommunicate/Classes/KMConversationViewController.swift
Sources/Kommunicate/Classes/KMConversationListViewController.swift
Sources/Kommunicate/Classes/ConversationDetail.swift
Sources/Kommunicate/Classes/ConversationVCNavBar.swift
Sources/Kommunicate/Classes/KMPushNotificationHelper.swift
Sources/Kommunicate/Classes/KMConversationService.swift
Sources/Kommunicate/Classes/KMBotService.swift
Sources/Kommunicate/Classes/KMAppSettingsService.swift
Sources/Kommunicate/Classes/Extensions/KMConfiguration+Extension.swift
Sources/Kommunicate/Classes/FaqViewController.swift
Sources/Kommunicate/Classes/MessageCharacterLimitManager.swift
Sources/Kommunicate/Classes/Models/ChatMessage.swift
Sources/Kommunicate/Classes/Models/KMMessageBuilder.swift
Sources/Kommunicate/Classes/KMConversationDetail.swift
Sources/Kommunicate/Classes/PricingPlan.swift
Sources/Kommunicate/Classes/Views/FeedbackRatingView.swift
Sources/Kommunicate/Classes/Views/KMFiveStarView.swift
Replaced AL/ALK-prefixed types, protocols, and services with KMCore/KMChat-prefixed equivalents in controllers, models, services, configuration, and extensions. Updated typealiases, protocol conformances, method signatures, and property types. Added new pricing plan constants and refactored plan-check logic. Added event publishing for feedback rating interactions.
Example/Tests/ConversationVCNavBarSnapshotTests.swift
Example/Tests/KMConversationViewControllerTests.swift
Example/Tests/KommunicateTests.swift
Example/Tests/Mocks/ConversationDetailMock.swift
Updated test code and mocks to use KMCore/KMChat-prefixed types instead of AL/ALK-prefixed ones. Changed property types, mock object instantiations, and method signatures accordingly.

Sequence Diagram(s)

sequenceDiagram participant User participant KMConversationListViewController participant KMChatConversationViewModel participant KMConversationViewController participant KMCoreChannelService participant KMCoreMessageService User->>KMConversationListViewController: Selects a conversation KMConversationListViewController->>KMChatConversationViewModel: Prepare view model KMConversationListViewController->>KMConversationViewController: Push with new view model KMConversationViewController->>KMCoreChannelService: Fetch channel info KMConversationViewController->>KMCoreMessageService: Sync messages KMConversationViewController->>User: Display conversation UI 
Loading

Possibly related PRs

  • #499: Also migrates from AL/ALK-prefixed classes to KMCore/KMChat-prefixed classes, indicating a shared refactoring effort.
  • #500: Modifies the getMetaDataWith(_:) method in KMConversationService to add language code with region, which is directly related to changes in this PR.
  • #501: Performs similar renaming and type substitution from AL/ALK to KMCore/KMChat across multiple files and tests, showing a code-level connection.

Suggested reviewers

  • adarshmishra

Poem

In the meadow of code, a rabbit hops,
Swapping old names for new, it never stops.
AL and ALK now hop away,
KMCore and KMChat come out to play.
With freshened types and modern cheer,
This codebase blooms—spring is here! 🐇✨

✨ Finishing Touches
  • 📝 Generate Docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.
@AbhijeetRanjan308 AbhijeetRanjan308 changed the base branch from master to dev June 17, 2025 07:30
@Kommunicate-io Kommunicate-io deleted a comment from github-actions bot Jun 17, 2025
@AbhijeetRanjan308
Copy link
Contributor Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
1 participant