Uh oh!
There was an error while loading. Please reload this page.
fix(calls/ios): 8 defects that do not compile against CometChatCallsSDK 5.0.4 - #489
Open
ashfaqcometchat wants to merge 1 commit into
Open
fix(calls/ios): 8 defects that do not compile against CometChatCallsSDK 5.0.4#489ashfaqcometchat wants to merge 1 commit into
ashfaqcometchat wants to merge 1 commit into
Conversation
…DK 5.0.4 Found while building the headless iOS calling skill (ENG-38735) by extracting every Swift fence under /calls/ios/** and type-checking it against the SHIPPED CometChatCallsSDK 5.0.4 + CometChatSDK 4.1.7 frameworks. Each defect is confirmed three ways: the live PR #482 preview, the shipped .swiftinterface, and the calls-core/ios-sdk source. D1 AudioModeType does not exist — 17 occurrences across 6 pages, including a whole "AudioModeType Values" accordion. The real enum is AudioMode (calls-core CallModels.swift:305); 0 hits in the interface AND 0 in the binary's exported symbols. The fix is NOT a rename: the docs' example implements MediaEventsListener, whose real signature is onAudioModeChanged(audioMode: AudioMode) — so the parameter LABEL was wrong too, along with the ObjC selector and the AudioModeType*Speaker constants. D2 CometChat.CallStatus -> CometChat.callStatus (lowercase c). ringing x2. rejectCall(sessionID:status:) takes CometChat.callStatus (CometChatSDK 4.1.7 L549/L1816). Swift is case-sensitive; the documented line cannot compile. D3 .setType(.video) -> .setSessionType(.video) — 8 occurrences across 5 pages. SessionSettingsBuilder has no setType (calls-core SessionSettingsBuilder.swift:120). Includes migration-guide-v5, where it sat under the *v5* tab, i.e. presented as the new API. D4 The SPM URL 404s. github.com/cometchat/cometchat-calls-sdk-ios returns 404; the package is at github.com/cometchat/calls-sdk-ios (its Package.swift declares name "CometChatCallsSDK"). This is step 2 of installation, so it breaks before a reader writes a line of code. D5 region documented as "us or eu" — `in` is also valid and is what several live apps use. The SDK does not restrict it (calls-core CometChatCalls.swift only guards region.length > 0), and the CHAT SDK docs already say "us", "eu", "in". 3 occurrences. D6 .setAppId()/.setRegion() are @available(deprecated) in 5.0.4 — "Use set(appID:) instead" (calls-core CallAppSettingsBuilder.swift:70-78). Both spellings are public, so this compiles with a warning rather than failing; the docs should teach the supported pair. D7 call.callInitiator?.name does not compile. callInitiator is AppEntity? (CometChatSDK 4.1.7 L950) and `name` lives on User : AppEntity (L1864/1869), so it needs a downcast. The ObjC variant has the same bug. D8 The migration guide's init snippet says "No changes required" and then shows CallAppSettings() followed by .set(appId:)/.set(region:). CallAppSettings has ONLY init() — no setters at all (calls-core CallAppSettings.swift:12); the setters are on CallAppSettingsBuilder, and it is set(appID:) with a capital ID. Corrected to the builder + .build(), and verified to compile. Verification: all 8 classes now return 0 across all 25 /calls/ios pages, and the corrected fences type-check. Of the 50 fences on the edited pages, the only remaining failures are snippet fragments referencing reader-supplied variables (authToken, sessionID, callViewContainer, listener instances) — expected in documentation, not defects. NOT changed, deliberately: bare `AudioMode` was initially flagged as ambiguous, but that was an artifact of the test harness importing BOTH SDKs. These pages import only the Calls SDK, so bare AudioMode is correct here. The ambiguity is real for an app doing 1:1 ringing (which needs both SDKs) and is recorded in the skill instead of over-qualifying every page. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Found while building the headless iOS calling skill (ENG-38735) by extracting every Swift fence under
/calls/ios/**and type-checking it against the shippedCometChatCallsSDK 5.0.4+CometChatSDK 4.1.7frameworks.Every defect is confirmed three ways: the live PR #482 preview, the shipped
.swiftinterface, and thecalls-core/ios-sdksource. Based ondocs/skills-v5-tempbecause that is the branch whose preview I verified against.The defects
AudioModeTypeAudioMode— 0 hits in the interface and 0 in the binary's exported symbols (calls-core CallModels.swift:305)CometChat.CallStatusCometChat.callStatus— lowercasec(CometChatSDK 4.1.7L549/L1816).setType(.video).setSessionType(.video)—SessionSettingsBuilderhas nosetType…/cometchat-calls-sdk-iosgithub.com/cometchat/calls-sdk-iosusoreu"inis also valid — the SDK only guardsregion.length > 0, and the Chat docs already sayus/eu/in.setAppId()/.setRegion().set(appID:)/.set(region:)call.callInitiator?.name(call.callInitiator as? User)?.name—callInitiatorisAppEntity?;nameis onUserCallAppSettings()+.set(appId:)under "No changes required"CallAppSettingshas onlyinit()— no setters. They are onCallAppSettingsBuilder, and it isset(appID:)D1–D4, D7 and D8 do not compile. D6 compiles with a deprecation warning.
Worth a closer look
D8 is the most costly — it is in the v4→v5 migration guide, under a heading that says "No changes required. The
initAPI is the same in v5." It is the first thing an upgrading developer copies, and it cannot build.D1 was not a rename. The docs' example implements
MediaEventsListener, whose real signature isonAudioModeChanged(audioMode: AudioMode)— so the parameter label was wrong too, along with the ObjC selector and theAudioModeType*constants. Swapping only the type name leaves the bodies broken (I did exactly that first, and caught it by recompiling).D3 in
migration-guide-v5sits under the v5 tab, so it is presented as the new API, not as legacy for contrast.Verification
/calls/iospagesauthToken,sessionID,callViewContainer, listener instances) — expected in documentation, not defectsDeliberately not changed
Bare
AudioModefirst looked ambiguous — the symbol exists in both SDKs — but that was an artifact of my harness importing both. These pages import only the Calls SDK, so bareAudioModeis correct here. The ambiguity is real for an app doing 1:1 ringing (which needs both SDKs), so it is recorded in the skill rather than over-qualifying every page.🤖 Generated with Claude Code