Skip to content

docs(js-sdk): add uploadFiles() documentation#427

Open
PrajwalDhuleCC wants to merge 1 commit into
mainfrom
docs/multi-attachment-js-sdk
Open

docs(js-sdk): add uploadFiles() documentation#427
PrajwalDhuleCC wants to merge 1 commit into
mainfrom
docs/multi-attachment-js-sdk

Conversation

@PrajwalDhuleCC

Copy link
Copy Markdown
Contributor

Description

  • Add new "Upload Files & Send Attachments" guide documenting CometChat.uploadFiles() flow with per-file progress, cancel, and retry
  • Add "Upload Files" page to JavaScript SDK Messaging section in docs.json
  • Document Media Upload error category and specific error codes (ERR_INVALID_FILE_OBJECT, ERR_FILE_SIZE_EXCEEDED, ERR_FILE_COUNT_EXCEEDED, ERR_S3_UPLOAD_FAILED, ERR_PRESIGNED_URL_EXPIRED, ERR_UPLOAD_STALLED, ERR_UPLOAD_CANCELLED) in error-codes.mdx
  • Update send-message.mdx to recommend upload-first pattern for multi-attachment composers and link to new upload guide
  • Add CometChat.getMaxAttachmentCount() runtime API reference for checking attachment limits
  • Clarify distinction between rejected (non-retryable) and failed (retryable) upload errors with MediaUploadListener callback mapping

Related Issue(s)

Type of Change

  • Documentation correction/update
  • New documentation
  • Improvement to existing documentation
  • Typo fix
  • Other (please specify)

Checklist

  • I have read the CONTRIBUTING document
  • My branch name follows the naming convention
  • My changes follow the documentation style guide
  • I have checked for spelling and grammar errors
  • All links in my changes are valid and working
  • My changes are accurately described in this pull request

Additional Information

Screenshots (if applicable)

…and media upload error codes

- Add new "Upload Files & Send Attachments" guide documenting CometChat.uploadFiles() flow with per-file progress, cancel, and retry
- Add "Upload Files" page to JavaScript SDK Messaging section in docs.json
- Document Media Upload error category and specific error codes (ERR_INVALID_FILE_OBJECT, ERR_FILE_SIZE_EXCEEDED, ERR_FILE_COUNT_EXCEEDED, ERR_S3_UPLOAD_FAILED, ERR_PRESIGNED_URL_EXPIRED, ERR_UPLOAD_STALLED, ERR_UPLOAD_CANCELLED) in error-codes.mdx
- Update send-message.mdx to recommend upload-first pattern for multi-attachment composers and link to new upload guide
- Add CometChat.getMaxAttachmentCount() runtime API reference for checking attachment limits
- Clarify distinction between rejected (non-retryable) and failed (retryable) upload errors with MediaUploadListener callback mapping
@mintlify

mintlify Bot commented Jul 12, 2026

Copy link
Copy Markdown

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

Project Status Preview Updated (UTC)
cometchat 🟢 Ready View Preview Jul 12, 2026, 7:53 PM

@raj-dubey1

Copy link
Copy Markdown
Contributor

📋 Docs review — ✅ Approve

Reviewed this PR for docs-breakage and content accuracy, cross-checked against the implementing SDK PR cometchat-team/chat-sdk-javascript#568.

Verdict: Approve. Structurally safe and content-accurate — near-perfect.

✅ What passed

  • Build safe: 0 unresolved nav refs; sdk/javascript/upload-files correctly added to JS SDK → Messaging in docs.json. Additive PR — no moves/renames, so no redirects needed. 0 orphans.
  • API surface exact vs. chat-sdk-javascript#568: uploadFiles(), cancelFileUpload(), retryFileUpload(), clearUploadGroup(), getMaxAttachmentCount(), CometChat.MediaUploadListener. Correctly does not invent a public getMaxAttachmentSize() (size lives only in the internal getUploadLimits() helper). ✓
  • Signatures & shapes match: callback signatures, { batchId, fileIds } return, "<batchId>:<index>" fileId format, rejected-vs-failed semantics, UploadResult shape.
  • Constants match code: 30s stall timeout, 15-min presign TTL, ~1% progress throttle, 100 MB default size, 10 default count, and all 7 error codes match CometChatErrorConstants.ts exactly.
  • All anchors resolve: #media-message, #multiple-attachments-in-a-media-message, #media-upload-errors, and the three /sdk/reference/* anchors.
  • Nice cleanup: the stale "Starting version 3.0.9 & above" claim in send-message.mdx was removed.

🔹 Minor / optional (non-blocking)

  • Verify with SDK author (likely a code quirk, not a doc issue): error-codes.mdx / upload-files.mdx present ERR_S3_UPLOAD_FAILED as unconditionally onFileFailure / retryable. That holds for the transport, abort, and whole-presign-failure paths, but in one path (UploadManager.processBatch → per-file presign entry with no form) the code calls rejectFile(…S3_UPLOAD_FAILED), surfacing it via onFileError (non-retryable). The blanket "retryable: Yes" is ~95% accurate.
  • Pre-existing, out of scope: the link scanner flagged /sdk/javascript/{default-call, direct-call, standalone-calling, interactive-messages} as broken, but these live in unchanged files (all-real-time-listeners.mdx, message-structure-and-hierarchy.mdx) and one pre-existing link in send-message.mdxnot introduced by this PR. Noting only for visibility.

🤖 Automated docs review (Claude Code), cross-checked against the implementing code PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Development

Successfully merging this pull request may close these issues.

2 participants