Repository navigation
Fix publication queue listing nothing; drop All tab - #407
Merged
Merged
Conversation
The backend stores datetime('now'), UTC with no zone marker, which
new Date() reads as local time. Tested in UTC, Pacific, and Tokyo.
The page read a nested status object the backend list route never sends, so rendering the first row threw and no request showed, including nm000290. Read the flat row the route returns instead. Tabs are now Pending (requested + approving), Published, Denied, Blocked, each with a count and one row per dataset (latest request). Old ?status=all and ?status=requested links land on Pending. Tested: unit tests on a scrubbed production response, typecheck, lint, build, and the page rendered against the full production list.
Deploying nemar-website with
|
| Latest commit: |
71d2c29
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://acbbe8a2.nemar-website.pages.dev |
| Branch Preview URL: | https://fix-admin-publication-queue.nemar-website.pages.dev |
Approval is not one request: after the DOI is published, S3 Object Lock runs in batches the caller must keep requesting. The CLI loops; this page sent one request, so a dataset over 100 files would stop at approving, public but unlocked and unannounced. Gate the button behind WEB_PUBLISH_APPROVE_ENABLED (off) and show the CLI command, with --resume for an approving request. Deny is unchanged. Tested: unit test for the command, typecheck, lint, and the page rendered in dev (no Approve button or dialog, Deny and hint present).
This was referenced Oct 1, 2026
neuromechanist
added a commit
that referenced
this pull request
Oct 1, 2026
Staging squash-merged #407, whose original commits this branch still carries. Take this branch's side of the overlapping files; it is a superset of what the squash contains.
This was referenced Oct 1, 2026
neuromechanist
added a commit
that referenced
this pull request
Oct 5, 2026
5 of 10 tasks
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.
Problem
/admin/publication-requestslisted nothing. nm000290 was requested at 12:46 UTC on 2026-10-01 and published at 13:50 UTC, and it appeared under no filter, "All" included.The data was never missing: production
GET /admin/publish/requestsreturns it as id 835,status: "published". The page could not read it. It was written against the owner-sidePublicationStatusobject (request.status.status,request.status.dataset_id, plus adataset_nameand anowner_emailthe route never sends), but the list route returns the rawpublication_requestsrow joined to the requester, withstatusas a plain string. Rendering the first row threwCannot use 'in' operator to search for 'requested_at' in published, so the list never completed. The unit tests passed because they built their responses from the same wrong shape.Changes
PublicationRequestnow matches the real row (dataset_id,status,requested_by_username,requested_by_email,approved_at,denied_at,denied_reason,block_reason,current_step,last_error).deriveAdminBadgeStatetakes a structural type so it accepts both shapes.The "All" tab is gone. Tabs are Pending, Published, Denied, Blocked, each with a count. Pending is the default.
requestedplusapproving. With no "All", anapprovingrequest (a run in flight or stopped partway) would otherwise match no tab.?status=alland the old?status=requestedland on Pending.The dataset id is the row heading, since the route sends no dataset name. Rows show requester username and email, relative times with the exact UTC instant in the tooltip, and the denial reason, block reason, or last orchestrator error where it applies.
block_reasonis read only on blocked rows. Production keeps a stale one on published and denied rows.parseBackendTimestamppins SQLitedatetime('now')values to UTC.new Date("2026-10-01 12:46:50")reads local time, so ages were off by the viewer's offset.The web Approve button is withheld behind
WEB_PUBLISH_APPROVE_ENABLED(off). Fixing the list makes the button reachable for the first time, and one click would half-publish a real dataset: approval runs S3 Object Lock in batches of 100 objects that the caller must keep requesting (the CLI loops; this page sent one request), so a dataset over 100 files would stop atapprovingafter its DOI is published. Pending rows shownemar admin publish approve <id>instead (--resumefor anapprovingrow). Deny is unchanged. The button returns when approval runs as a backend job that an executor drives to completion (website#200).Testing
bun run typecheck(0 errors),bun run lint,bun run test(2730 passed),bun run buildtest/fixtures/admin-publish-requests.json: real rows from a production response, with requester identity and prescreen tokens scrubbed. Time-zone tests also run underAmerica/Los_AngelesandAsia/Tokyo.Not changed
{ status: PublicationStatus }return type the backend does not send. The page ignores the return value, so nothing breaks today.Approve failed: <status text>. The backend sends{ error: "<sentence>" }, whichreadErrorfiles undercode, so the specific reason (for example "CI check failed: BIDS validation is failing") is dropped.dataset_nameadded to the list route in nemar-cli.