[codex] Implement async public export jobs#13
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 652a0eb6c9
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| "download_url": None, | ||
| "report_url": None, | ||
| "error_code": None, | ||
| "cancel_requested": False, |
There was a problem hiding this comment.
Prevent canceled job retry from reviving prior worker
retry_public_export_job flips cancel_requested back to False immediately, but the original worker thread may still be executing export_docx after a cancel. In that window, retry starts a second thread on the same job_id, and the first thread will now observe no cancellation and continue writing progress/artifacts, creating a race where two workers update the same job/export state unpredictably. Gate retry until the previous attempt is definitively finished, or version attempts so stale workers cannot resume after a retry.
Useful? React with 👍 / 👎.
| if (!jobId) { | ||
| setExporting(false); | ||
| setInlineError({ message: "导出已取消,可重新导出。", code: "EXPORT_CANCELED" }); | ||
| return; |
There was a problem hiding this comment.
Cancel server job even when job ID is not yet available
When users cancel while createPublicExportJob is still in flight, this branch returns early without calling the backend cancel endpoint. After the create request resolves, the client stops polling due cancelRequestedRef, but the server job keeps running to completion and retains export files, so cancellation is only local/UI-visible. Queue a deferred cancel and issue /cancel as soon as job_id arrives to preserve true cancellation semantics.
Useful? React with 👍 / 👎.
Summary
Validation
Closes #11