Skip to content

fix: wait for publish operation to complete before reporting success#93

Open
DanielSinclair wants to merge 1 commit into
PlasmoHQ:mainfrom
DanielSinclair:fix/wait-for-publish-status
Open

fix: wait for publish operation to complete before reporting success#93
DanielSinclair wants to merge 1 commit into
PlasmoHQ:mainfrom
DanielSinclair:fix/wait-for-publish-status

Conversation

@DanielSinclair

@DanielSinclair DanielSinclair commented Feb 10, 2026

Copy link
Copy Markdown

Summary

submit() previously fired the publish request and returned immediately after receiving a 202 Accepted, without polling the publish status endpoint to verify the operation completed. The getPublishStatus() method existed but was never called from the submit flow.

This meant async publish failures were silently ignored and the extension remained as a draft. The following error codes would go undetected:

  • NoModulesUpdated — no changes since last submission
  • InProgressSubmission — another submission already under review
  • SubmissionValidationError — submission validation failures
  • ModuleStateUnPublishable — extension has invalid modules
  • UnpublishInProgress — extension is being unpublished
  • CreateNotAllowed — can't create new extension

Changes

  • submit() now calls waitForPublish() after publish(), polling getPublishStatus() until the operation reaches Succeeded or Failed
  • Mirrors the existing waitForUpload() pattern and Microsoft's reference implementation (10 retries, 5s intervals)
  • Test updated to assert publishStatus.status === "Succeeded"

Test plan

  • Verify integration test passes with pnpm dlx @plasmohq/mystic-box test-zip 0.0.8 + valid key.json
  • Verify failed publishes throw with the actual Microsoft error message
  • Verify timeout after max retries throws "Publish operation timed out"

submit() previously fired the publish request and returned immediately
after receiving a 202 Accepted, without verifying the publish operation
actually succeeded. This meant async failures (e.g. NoModulesUpdated,
InProgressSubmission, SubmissionValidationError) were silently ignored
and the extension remained as a draft.

Add waitForPublish() that polls getPublishStatus() — mirroring the
existing waitForUpload() pattern — so publish failures now surface
as errors instead of false successes.
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.

1 participant