docs(js-sdk): document resumeUpload, recoveryToken, and FileState#88
Open
dobby-coder[bot] wants to merge 1 commit into
Open
docs(js-sdk): document resumeUpload, recoveryToken, and FileState#88dobby-coder[bot] wants to merge 1 commit into
dobby-coder[bot] wants to merge 1 commit into
Conversation
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
Contributor
Author
There was a problem hiding this comment.
LGTM (cannot self-approve). Verified against postguard-js@6205fc309a:
FileStateshape in the table (token / prevToken / uuid / recoveryToken) matchessrc/api/cryptify.ts#L13-L33, including theprevToken-undefined-until-first-commit detail.resumeUploadsignature, return type,X-Recovery-Tokenheader, and wire-field mapping (cryptify_token→state.token, optionalprev_token→state.prevToken) match L143-L178.- Both symbols are re-exported from postguard-js
src/index.ts. UploadSessionExpiredErroranchor target exists indocs/sdk/js-errors.md#L51.- postguard-js#68 is open and tracks the
UploadResult.recoveryTokenfollow-up — the 'Current limitation' callout is accurate, not stale. npm run docs:buildsucceeds (~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.
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.
Closes #83.
Adds a Resume an interrupted upload section to
docs/sdk/js-encryption.mdcovering the new public exports from encryption4all/postguard-js#66:FileStateshape and the two persistable fields (uuid,recoveryToken).resumeUpload(cryptifyUrl, uuid, recoveryToken, signal?)signature, return type, and wire-field mapping (cryptify_token→state.token,prev_token→state.prevToken,X-Recovery-Tokenrequest header).upload_session_not_foundsurfaces asUploadSessionExpiredError; cryptify collapses unknown UUID and wrong recovery token into the same response.Amends
docs/sdk/js-errors.mdso 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
resumeUploadandFileStateare re-exported by@e4a/pg-js, butpg.encrypt(...).upload()does not yet surfacerecoveryTokenonUploadResult. 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:buildsucceeds in ~6s.curl -sI).postguard-docs/CLAUDE.mdstyle rules).Reviewer quickstart
```
git fetch origin && git checkout docs/js-sdk-resume-upload && npm install && npm run docs:dev
```