Skip to content

docs(js-sdk): document onUploadInit callback for upload resume#95

Merged
rubenhensen merged 1 commit into
mainfrom
docs/onuploadinit-callback
May 17, 2026
Merged

docs(js-sdk): document onUploadInit callback for upload resume#95
rubenhensen merged 1 commit into
mainfrom
docs/onuploadinit-callback

Conversation

@dobby-coder
Copy link
Copy Markdown
Contributor

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

Summary

Documents the onUploadInit callback added in encryption4all/postguard-js#71 (merged at dcdd6591) on UploadOptions and CreateEnvelopeOptions. Replaces the stale "Current limitation" paragraph in docs/sdk/js-encryption.md that pointed at encryption4all/postguard-js#68; that issue is now resolved.

The new subsection under "Resume an interrupted upload" covers:

  • Signature: (info: { uuid: string; recoveryToken: string }) => void
  • When it fires: once, synchronously, after upload_init resolves and before the first chunk PUT
  • Use: persist {uuid, recoveryToken} so a later resumeUpload can rehydrate after a process restart
  • Caveat from the source JSDoc: runs inside the upload stream's start handler; a throw errors the stream
  • Examples for both Sealed.upload and createEnvelope
  • Source links pinned to the postguard-js merge commit

Source verified against src/types.ts#L107-L112 (UploadOptions) and src/types.ts#L246-L250 (CreateEnvelopeOptions) at dcdd6591f58976364f8220f4cedbe86d0e2bce3b.

Closes #94

Test plan

  • npm run docs:build succeeds (~6s)
  • Built dist/sdk/js-encryption.html contains the new onUploadInit content
  • Source-link URLs return HTTP 200 at the pinned commit
  • Writing style: no banned words, no em dashes, no inflated bold

Reviewer quickstart

git fetch origin && git checkout docs/onuploadinit-callback && npm install && npm run docs:dev

Then open http://localhost:5173/sdk/js-encryption.html#capture-recoverytoken-via-onuploadinit

Adds an 'onUploadInit' subsection under 'Resume an interrupted upload' in
docs/sdk/js-encryption.md covering the callback added in postguard-js#71
on UploadOptions and CreateEnvelopeOptions, with the signature, firing
contract, persistence use case, and stream-handler caveat.

Removes the stale 'Current limitation' paragraph that pointed at
postguard-js#68 — that issue is resolved by #71.

Closes #94
@dobby-coder dobby-coder Bot requested a review from rubenhensen May 16, 2026 21:37
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.

Reviewed and verified (bot cannot self-approve, so this is a comment review):

  • Source links resolve and the line ranges match the JSDoc at dcdd6591 (verified via raw.githubusercontent).
  • UploadOptions.onUploadInit is at src/types.ts#L107-L112; the CreateEnvelopeOptions forward is at src/types.ts#L246-L250. Both check out.
  • Examples for Sealed.upload and createEnvelope mirror the public API correctly.
  • The replaced "Current limitation" paragraph referenced the now-resolved postguard-js#68 follow-up; removal is appropriate.
  • npm run docs:build succeeds in ~6s; built page contains the new section.
  • Writing style holds: no banned words, no em dashes, no extraneous bold.

No blockers. LGTM, ready for @rubenhensen to merge.

@dobby-coder
Copy link
Copy Markdown
Contributor Author

dobby-coder Bot commented May 16, 2026

Rule compliance pass found two issues in the PR body (docs content itself is clean):

  • Bare cross-repo reference postguard-js#68 — GitHub doesn't auto-link bare repo#NN across repos. Rewrote as encryption4all/postguard-js#68 per the cross-repo-link-format rule.
  • Em dash in the same sentence — postguard-docs writing rules target zero em dashes. Replaced with a semicolon.

No code changes.

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.

Verified at commit 0111f3a (bot cannot self-approve, so this is a comment review with an approve verdict):

  • Source links return HTTP 200 at dcdd6591; both line ranges match the JSDoc and signatures (UploadOptions L107-L112, CreateEnvelopeOptions L246-L250).
  • npm install + npm run docs:build succeed in ~23s; built dist/sdk/js-encryption.html contains the new onUploadInit section.
  • Examples for both Sealed.upload and createEnvelope mirror the public API as defined in postguard-js types.
  • Replacing the old 'Current limitation' paragraph is correct now that the linked postguard-js follow-up is resolved.
  • Writing style is clean: no banned words, no em dashes, no inflated bold.

Verdict: approve. Ready for @rubenhensen to merge.

@rubenhensen rubenhensen merged commit e2264f8 into main May 17, 2026
1 check passed
@rubenhensen rubenhensen deleted the docs/onuploadinit-callback branch May 17, 2026 16:04
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 onUploadInit callback on UploadOptions / CreateEnvelopeOptions

1 participant