Skip to content

docs(js-sdk): document resumeUpload, recoveryToken, and FileState#88

Open
dobby-coder[bot] wants to merge 1 commit into
mainfrom
docs/js-sdk-resume-upload
Open

docs(js-sdk): document resumeUpload, recoveryToken, and FileState#88
dobby-coder[bot] wants to merge 1 commit into
mainfrom
docs/js-sdk-resume-upload

Conversation

@dobby-coder
Copy link
Copy Markdown
Contributor

@dobby-coder dobby-coder Bot commented May 13, 2026

Closes #83.

Adds a Resume an interrupted upload section to docs/sdk/js-encryption.md covering the new public exports from encryption4all/postguard-js#66:

  • FileState shape and the two persistable fields (uuid, recoveryToken).
  • resumeUpload(cryptifyUrl, uuid, recoveryToken, signal?) signature, return type, and wire-field mapping (cryptify_tokenstate.token, prev_tokenstate.prevToken, X-Recovery-Token request header).
  • 404 with upload_session_not_found surfaces as UploadSessionExpiredError; cryptify collapses unknown UUID and wrong recovery token into the same response.

Amends docs/sdk/js-errors.md so the "no resume path" line scopes to the post-expiry case and cross-links the new section.

Source links pinned to postguard-js merge commit 6205fc309a.

Honest gap

resumeUpload and FileState are re-exported by @e4a/pg-js, but pg.encrypt(...).upload() does not yet surface recoveryToken on UploadResult. Capturing the token from the public API needs a follow-up on postguard-js, tracked at encryption4all/postguard-js#68. The new docs section calls this out explicitly so readers are not misled into thinking the high-level path is wired up.

Verification

  • npm install && npm run docs:build succeeds in ~6s.
  • Source link URL HTTP 200 at the pinned commit (curl -sI).
  • No banned words, em dashes, or banned transitions introduced (per postguard-docs/CLAUDE.md style rules).

Reviewer quickstart

```
git fetch origin && git checkout docs/js-sdk-resume-upload && npm install && npm run docs:dev
```

Adds a 'Resume an interrupted upload' section to the JS SDK encryption
page covering the new exports from postguard-js#66:

- FileState shape and persistable fields (uuid, recoveryToken)
- resumeUpload signature, behaviour, and wire-field mapping
- 404 -> UploadSessionExpiredError; unknown UUID and wrong token collapse

Amends the js-errors page so the 'no resume path' line scopes to the
post-expiry case and cross-links the new section.

Source links pinned to postguard-js merge commit 6205fc309a.

Refs #83
Refs encryption4all/postguard-js#68
Copy link
Copy Markdown
Contributor Author

@dobby-coder dobby-coder Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM (cannot self-approve). Verified against postguard-js@6205fc309a:

  • FileState shape in the table (token / prevToken / uuid / recoveryToken) matches src/api/cryptify.ts#L13-L33, including the prevToken-undefined-until-first-commit detail.
  • resumeUpload signature, return type, X-Recovery-Token header, and wire-field mapping (cryptify_tokenstate.token, optional prev_tokenstate.prevToken) match L143-L178.
  • Both symbols are re-exported from postguard-js src/index.ts.
  • UploadSessionExpiredError anchor target exists in docs/sdk/js-errors.md#L51.
  • postguard-js#68 is open and tracks the UploadResult.recoveryToken follow-up — the 'Current limitation' callout is accurate, not stale.
  • npm run docs:build succeeds (~7s) on this branch.
  • No banned words, em dashes, or banned transitions introduced in the diff.

The errors-page edit correctly narrows the 'no resume path' line to the post-expiry case and cross-links the new section.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

docs(js-sdk): document resumeUpload, recoveryToken, and FileState for cross-restart upload resume

0 participants