Repository navigation
docs(offline): Offline Support for the JavaScript SDK, React UI Kit and Angular UI Kit - #566
Draft
raj-dubey1 wants to merge 3 commits into
Draft
raj-dubey1 wants to merge 3 commits into
raj-dubey1 wants to merge 3 commits into
Conversation
…nd Angular UI Kit Add an Offline Support page under each product's messaging/core features: - sdk/javascript/offline-support (Messaging group) - ui-kit/react/offline-support and ui-kit/angular/offline-support (Features > Chat, after Core) Add an Offline Support section to the React and Angular core-features pages, list the pages in the llms indexes, and add the /ui-kit/react/v7/offline-support alias redirect that every React v7 page has. Content is limited to what is common to the Android, iOS, Flutter, JavaScript and React Native offline SDK lines. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Automations to automatically generate PRs for you. |
- JS SDK: correct the `enabled` default. It is false when setOfflineConfig() is never called and true when an object omits it (resolveOfflineConfig). - JS SDK: onCachedConversation is not called when the conversation is not cached. - JS SDK: TypeScript/JavaScript tabs on the encryption snippet. - React UI Kit: note that the kit calls setOfflineConfig() without a guard, so an older JS SDK makes init() reject; note the object form turns offline on. - React UI Kit: drop the scroll-up-offline claim (Angular stops paging after the cached page, so it is not common). - Angular UI Kit: note the typeof guard, which ignores the setting (and the default) on an older SDK; note the object form turns offline on. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 task done
…SDK and kits JavaScript SDK page: - List every OfflineConfig key with its real default and range, and show enabled: true explicitly instead of relying on the omitted-key default. - Add failed messages and retry (PENDING/SENDING/FAILED, retryMessage, retryAllFailedMessages), onMessagesSynced, and a reference table for forceSyncNow, getSyncState, getLastSyncTimestamp, getCacheSize, clearOfflineCache and the media methods. - Document encryptionFailureBehavior, correct the secure-context wording, add browser notes (iframes, multiple tabs) and an Electron section that is marked to publish only after the pending SDK fix. - Add a minimum-version placeholder. React and Angular UI Kit pages: - Show enabled: true explicitly, note that initFromSettings doesn't enable offline support, describe the sending indicator, and point to the SDK retry methods. Rephrase the Angular opt-out so it stays correct when the kit default changes. Add minimum-version placeholders. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch was successfully deployed
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 free
to 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.
Description
Adds Offline Support docs for the JavaScript SDK, React UI Kit (v7) and Angular UI Kit (v5). The React Native SDK and UI Kit are in a separate PR.
Files
sdk/javascript/offline-support.mdxisOfflineEnabled, two-phase reads, queued sends, pending messages, sync listener, encryption, logout, limitationsui-kit/react/offline-support.mdxUIKitSettingsBuilder.setOfflineConfig()and what changes in the componentsui-kit/angular/offline-support.mdxui-kit/react/core-features.mdx,ui-kit/angular/core-features.mdxdocs.json/ui-kit/react/v7/offline-support→/ui-kit/react/offline-support, the alias every React v7 page has. Angular has no alias redirects, and SDK pages have none for new pagessdk/javascript/llms-javascript-v4.mdx,ui-kit/react/llms-react-v7.mdx,ui-kit/angular/llms-angular-v5.mdxVerified against source
f19fbaf. Signatures were checked indist/index.d.ts. The runtime exports were checked by loadingdist/CometChat.jsin Node:MessageFetchListener,ConversationFetchListener,SingleConversationFetchListener, the other list listeners,MessageSentListener,SyncListener,MediaCachingMode,PendingMessageOverflowPolicy,isOfflineEnabledandgetOfflineEncryptionStatusall exist. Defaults come fromsrc/lib/offline/OfflineConfig.ts.src/lib/CometChat.ts. A queued send firesonMessagePending, thenonError(FAILED_TO_FETCH)once, and the Promise rejects;onMessageSentfollows after reconnect.805128a:UIKitSettings.ts:450, and the pass-through inCometChatUIKit.ts:136.cf0b361:UIKitSettings.ts:226. WhensetOfflineConfig()isn't called,resolveOfflineConfig()incometchat-uikit.ts:221returns{ enabled: true, mediaCaching: 'AUTO' }.Points for reviewers
enabled: trueexplicitly, and its Warning tells apps that want online-only to passsetOfflineConfig({ enabled: false }), which stays correct after the kit default is fixed.onError(FAILED_TO_FETCH)and the Promise rejects. In RN,onErroris not called and the Promise rejects withERROR_OFFLINE_MESSAGE_QUEUED. Each page documents its own SDK's behaviour.onErrorthat followsonMessagePending, so a queued message shows the sending (clock) indicator.CometChatUIKit.sendTextMessage()and the other static senders (_sendWithListener) don't, so they mark a queued message as failed until it is sent. The React page describes the composer behaviour only.Checks
docs.jsonparses. Every new nav entry resolves to a file, the redirect destination exists, and there are no duplicate redirect sources.npx mint broken-linksreports "no broken links found". The 5 parse errors it prints are pre-existing inui-kit/react/integration-*.mdxandoverview.mdx, which this PR doesn't touch.Update: verification pass (second commit)
The JS page now relaxes the scope rule where integrators need JS-only behaviour. It covers all 14
OfflineConfigkeys, failed messages andretryMessage/retryAllFailedMessages,onMessagesSynced, the other offline methods (forceSyncNow,getSyncState,getLastSyncTimestamp,getCacheSize,clearOfflineCache, the media methods and listeners),encryptionFailureBehavior, browser notes (iframes, multiple tabs, secure contexts) and Electron. Each claim was checked against JS SDKf19fbaf, React UI Kit805128aand Angular UI Kitcf0b361.Before merging:
vX.Y.Zminimum versions on all three pages. Each has aTODO(release)comment.TODO(release)comment.enabled: trueexplicitly. None of them relies on the current behaviour where a config object withoutenabledturns offline on.Scope rule
The docs cover only what is common to the offline lines on all five SDKs (Android
release-v5-v5.1.0, iOSENG-37599/ios-offline-sdk-support, Flutter PR #269, JavaScript PR #590, React Native PR #440), as checked in source on 2026-10-16.Documented (common to all):
setOfflineConfigand the config optionsenabled,maxPendingMessages,pendingQueueOverflowPolicy,autoSendPendingOnReconnect,mediaCaching,maxMediaCacheSize,encryption;isOfflineEnabled()and the server switch-off; cache-then-server reads for messages, conversations,getConversation, users, blocked users, groups, members, banned members, reactions and the notification feed; queued sends throughMessageSentListener;getPendingMessages();SyncListenerphase callbacks (used only as start, complete and error signals);getOfflineEncryptionStatus(); wipe on logout and on user switch.Left out, with the platform that lacks it:
retryMessage/retryAllFailedMessages,forceSyncNow,getSyncState,getLastSyncTimestamp,clearOfflineCache,getCacheSize: stubs on iOS.onMessagesSyncedand SYNC-tagged redelivery: stubs on iOS.addOfflineMessageListener): named differently on iOS, andonOutboxMessagePendingnever fires there.downloadMedia,getCachedMediaPath, media download listener,Attachmentlocal path): stubs or a different shape on iOS.maxStorageSize,maxMessagesPerConversation,maxConversationsandcacheDurationDays: eviction isn't wired on iOS.offline(bool): missing on iOS.getMessageDetailstwo-phase reads: missing on Android and Flutter respectively.deletePendingMessage(Flutter only) and durable uploads (getExistingUploadFileRequest).UI Kit pages cover what all six kits do: turn offline on in settings; cached-then-server conversations and messages; offline sends shown right away and sent on reconnect; cached media; attachment retry and restore. None of the kits has an offline banner, a retry-failed-message action or new component props.
Type of Change
🤖 Generated with Claude Code