Repository navigation
Conversation
A deposit carries the PDF only when anyone may get it, and DOCiD's update route can't add a file. When a report DOCiD already holds opens (an embargo ending, or a reviewer opening a private file), the registrar now adds its PDF to the record through doi-sync-core's addFile, which looks for it on the record first so a retry never mints a second Handle. The file's Handle is kept on the report's DOCiD registration (fileHandle), so it is never sent again. A PDF over DOCiD's 25 MB limit is left out: the registration is done and its error says why. Every add is logged with DOCiD's answer and the Handle.
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the
|
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Ports #1694 to
prodand nothing else: one commit cherry-picked ontoorigin/prod.devis not merged in. Don't merge or deploy without a decision from the team.The bug. A report published with an embargo never got its PDF on DOCiD. The deposit sends the file only when anyone may get it. When the embargo ended,
openEmbargoesregistered the report again, but the registrar only updated DOCiD's title, description and DOI.The fix. It is the same as #1694:
addFile(feat(docid): add a file to a deposited record, once doi-sync-core#25, pinned at its merge commit 1571758). DOCiD gives the file a Handle of its own, kept on the report asregistrations.docid.fileHandle.addFilereads the record's files first, so a lost answer or a file the deposit already carried is found and never sent twice.report-docid-file-add,report-docid-file-added,report-docid-file-too-large).Differences from #1694. The test file keeps prod's tests (dev's ISSN-correction test isn't on prod), and prod has no
accountsId, so the new test doesn't clear it.Proven on shared dev (#1694, Convex pushed at 7d65ae6, DOCiD Sandbox):
publications_files: [].reports/fileAccess:openEmbargoesran after midnight UTC.cb377aac6cbd_R100748.pdf: Report type, "Full text", CC-BY-4.0, 2026-11, its own Handle 20.500.14351/0efb9984d7833f3f5386. The report keeps that Handle asfileHandle, with no registration error. The file downloads as a PDF, and DOCiD's publicget-publication/5275lists it.What prod needs. No migration:
fileHandleis a new optional field. No new env var. Prod's DOCiD is already in Custom mode with the production account (user 203), and the embargo cron already runs there. The Convex push has to come from a checkout withnpm installrun after this pin.Effect on prod's data, read 2026-12-02. Prod has 6 live reports on DOCiD (R100012, R100015, R100016, R100018, R100020, R100021). All are open, and their deposits carried the PDF. None is embargoed. On each one's next registration, the registrar reads the record's files once and keeps the Handle it finds, with no upload and no mint. Production DOCiD lists those files as
<12 hex>_R1000NN.pdf, read-only for records 6833 and 6837, which the client matches. The largest of their PDFs is R100015's, at 11.8 MB.Checks on this branch:
npx tsc --noEmit, and vitest onconvex/reports/{registration,identifiers,paper}.test.ts(31 passed).