Skip to content

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
mainfrom
docs/offline-support-web
Draft

raj-dubey1 wants to merge 3 commits into
mainfrom
docs/offline-support-web

Conversation

@raj-dubey1

@raj-dubey1 raj-dubey1 commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

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.

Do not merge yet. The JS SDK offline work is PR cometchat-team/chat-sdk-javascript#590 ("Don't merge yet"). The React UI Kit work is cometchat-team/uikit-react#2361 ("Don't Merge Yet"). The Angular work is on the feature/offline-uikit-integration branch, with no PR. None of them is released, so these pages must not go live until they ship. Add the minimum SDK and UI Kit versions before merging.

Files

File Change
sdk/javascript/offline-support.mdx New page: enable, options, isOfflineEnabled, two-phase reads, queued sends, pending messages, sync listener, encryption, logout, limitations
ui-kit/react/offline-support.mdx New page: UIKitSettingsBuilder.setOfflineConfig() and what changes in the components
ui-kit/angular/offline-support.mdx New page: same, for Angular
ui-kit/react/core-features.mdx, ui-kit/angular/core-features.mdx New "Offline Support" section, and the feature added to the AI quick-reference list
docs.json Nav: JS SDK → Messaging (after Reactions). React and Angular → Features → Chat (after Core). Redirect: /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 pages
sdk/javascript/llms-javascript-v4.mdx, ui-kit/react/llms-react-v7.mdx, ui-kit/angular/llms-angular-v5.mdx LLM index entries

Verified against source

  • JS SDK at PR #590 head f19fbaf. Signatures were checked in dist/index.d.ts. The runtime exports were checked by loading dist/CometChat.js in Node: MessageFetchListener, ConversationFetchListener, SingleConversationFetchListener, the other list listeners, MessageSentListener, SyncListener, MediaCachingMode, PendingMessageOverflowPolicy, isOfflineEnabled and getOfflineEncryptionStatus all exist. Defaults come from src/lib/offline/OfflineConfig.ts.
  • The offline send contract is taken from src/lib/CometChat.ts. A queued send fires onMessagePending, then onError(FAILED_TO_FETCH) once, and the Promise rejects; onMessageSent follows after reconnect.
  • React UI Kit at 805128a: UIKitSettings.ts:450, and the pass-through in CometChatUIKit.ts:136.
  • Angular UI Kit at cf0b361: UIKitSettings.ts:226. When setOfflineConfig() isn't called, resolveOfflineConfig() in cometchat-uikit.ts:221 returns { enabled: true, mediaCaching: 'AUTO' }.

Points for reviewers

  1. Angular turns offline on by default; React and every other kit default to off. The Angular page no longer documents the default. It shows enabled: true explicitly, and its Warning tells apps that want online-only to pass setOfflineConfig({ enabled: false }), which stays correct after the kit default is fixed.
  2. The queued-send contract differs between JS and RN. In JS, a queued send calls onError(FAILED_TO_FETCH) and the Promise rejects. In RN, onError is not called and the Promise rejects with ERROR_OFFLINE_MESSAGE_QUEUED. Each page documents its own SDK's behaviour.
  3. React static send API. The composer ignores the onError that follows onMessagePending, 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.json parses. Every new nav entry resolves to a file, the redirect destination exists, and there are no duplicate redirect sources.
  • Every internal link and anchor in the changed files resolves.
  • npx mint broken-links reports "no broken links found". The 5 parse errors it prints are pre-existing in ui-kit/react/integration-*.mdx and overview.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 OfflineConfig keys, failed messages and retryMessage / 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 SDK f19fbaf, React UI Kit 805128a and Angular UI Kit cf0b361.

Before merging:

  • Fill in the vX.Y.Z minimum versions on all three pages. Each has a TODO(release) comment.
  • Publish the Electron section only once the SDK's IPC path-validation fix ships. Otherwise remove the section; it is marked with a TODO(release) comment.
  • Every page shows enabled: true explicitly. None of them relies on the current behaviour where a config object without enabled turns 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, iOS ENG-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): setOfflineConfig and the config options enabled, 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 through MessageSentListener; getPendingMessages(); SyncListener phase 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.
  • onMessagesSynced and SYNC-tagged redelivery: stubs on iOS.
  • The sync callback payloads: empty on iOS.
  • The outbox observer (addOfflineMessageListener): named differently on iOS, and onOutboxMessagePending never fires there.
  • The media APIs (downloadMedia, getCachedMediaPath, media download listener, Attachment local path): stubs or a different shape on iOS.
  • The cache limits maxStorageSize, maxMessagesPerConversation, maxConversations and cacheDurationDays: eviction isn't wired on iOS.
  • offline(bool): missing on iOS.
  • Threads and getMessageDetails two-phase reads: missing on Android and Flutter respectively.
  • Offline pinned and saved lists: still open PRs on Android.
  • Wipe on token expiry: missing on iOS.
  • Electron (JS-only, with an open security blocker), 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

  • New documentation

🤖 Generated with Claude Code

…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>
@mintlify

mintlify Bot commented Oct 16, 2026 •

Copy link
Copy Markdown

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated
cometchat 🟢 Ready View Preview Oct 19, 2026, 4:23 PM

💡 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>
…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

1 active deployment
staging — fa0a401c Deployed Oct 19, 2026 by mintlify[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant