Repository navigation
Worksheet ORCIDs, track keywords, abstract limit and Remove poster - #83
Conversation
…oval in the grid - Worksheet authors replace the extracted ones, so those without an ORCID go through the extraction API's ORCID lookup (POST /orcid/lookup, same strict rules as extraction) and fill as unsaved changes. Extracted ORCIDs also carry over when the same name is split differently (Wendy Jansen | Holleboom). - A Curious track or EasyChair topic (keywords_added) is added to the poster's keywords instead of replacing them. - Submission abstracts are limited to 10,000 characters, four times ARVO's 2,500, in the grid check and the strict form. - Remove poster in the review grid deletes that draft and its file from the batch; staged-poster DELETE takes a posterId from this batch.
|
Thank you for submitting this pull request! We appreciate your contribution to the project. Before we can merge it, we need to review the changes you've made to ensure they align with our code standards and meet the requirements of the project. We'll get back to you as soon as we can with feedback. Thanks again! |
Reviewer's GuideAPIDefine the 10,000-character submission-abstract limit in the strict form schema so submissions exceeding it are rejected.
Add an authenticated endpoint that forwards worksheet-author ORCID lookups to the extraction API and returns results in input order.
Extend staged-poster DELETE to remove only batch-created drafts by poster ID while retaining its file-path removal behavior.
ImplementationMerge worksheet track and topic keywords into existing keywords without duplicating them, and improve matching of creator names with differently split given and family names.
Centralize the abstract-length limit and user-facing validation message used by grid and workbook checks.
Make batch poster removal update the job for successfully completed deletion steps even when a later cleanup step fails.
Validate abstract length in workbook and grid imports, and skip posters removed during a concurrent grid save rather than failing the save.
UICheck abstract length before any grid save, including draft saves, and display the resulting validation issue.
Look up missing worksheet-author ORCIDs in the background and apply results only when the poster and author identity still match and the cell remains empty.
Add a confirmed Remove poster action that deletes the batch-created draft and file, removes its rows without reloading, and coordinates removal with saves.
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
|
Thanks for making updates to your pull request. Our team will take a look and provide feedback as soon as possible. Please wait for any GitHub Actions to complete before editing your pull request. If you have any additional questions or concerns, feel free to let us know. Thank you for your contributions! |
There was a problem hiding this comment.
Hey - I've found 8 issues
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location path="shared/utils/posterSheetToGrid.ts" line_range="57" />
<code_context>
+function fullName(row: BulkReviewGridRow): string {
+ return norm(`${row.given_name ?? ""} ${row.family_name ?? ""}`).replace(
+ / /g,
+ "",
+ );
+}
</code_context>
<issue_to_address>
**Wrong identifiers copied between authors**
When distinct names have given/family boundaries that produce the same space-stripped normalized name and only one extracted row matches, `fullName` removes every space, so `samePerson` treats the distinct authors as the same person and `carryIdentifiers` copies the extracted row’s identifiers to the worksheet author. The worksheet then shows identifiers belonging to someone else.
Preserve name-token boundaries when comparing names so distinct given/family splits are not treated as the same person.
Also at `shared/utils/posterSheetToGrid.ts:64-65`.
</issue_to_address>
### Comment 2
<location path="app/components/conferences/BulkImportMetadataGrid.vue" line_range="1623" />
<code_context>
+ orcidLookedUp.add(personKey(row));
+ const orcid = orcids[index];
+ // Leave a cell the organizer filled while the lookup ran.
+ if (!orcid || (row.name_identifier ?? "").trim()) return;
+ onCellInput(row, "name_identifier", orcid);
+ found += 1;
</code_context>
<issue_to_address>
**Old ORCID attached to edited author**
When an organizer changes a worksheet author’s name or affiliations while the ORCID lookup is in flight, `lookupSheetCreatorOrcids` checks only that the row is still present and its ORCID cell is empty, then `onCellInput` writes the result for the submitted identity onto the edited row. The grid shows an ORCID for a different person.
Before applying the lookup result, verify that the row’s name and affiliations still match the values submitted for that lookup.
Also at `app/components/conferences/BulkImportMetadataGrid.vue:1624`.
</issue_to_address>
### Comment 3
<location path="server/api/bulk-poster-submissions/[jobId]/staged-poster.delete.ts" line_range="47" />
<code_context>
+ statusMessage: "Poster not found in this import",
+ });
+ }
+ const result = await removePostersFromBulkImportJob(
+ session.user.id,
+ jobId,
</code_context>
<issue_to_address>
**Failed removal leaves stale batch state**
When draft deletion succeeds but a subsequent Bunny or file cleanup, or job update, fails, `removePostersFromBulkImportJob` has already deleted the draft when the later step fails, leaving the batch’s poster or staged-file records unchanged. The request fails while the batch still references the deleted poster.
Make draft deletion and batch/file cleanup atomic, or reconcile the batch state when a later removal step fails.
</issue_to_address>
### Comment 4
<location path="app/components/conferences/BulkImportMetadataGrid.vue" line_range="575-585" />
<code_context>
const posterName = posterDisplayName(row.poster_id ?? "");
+ const abstractLength = (row.submission_abstract ?? "").length;
+ if (abstractLength > MAX_SUBMISSION_ABSTRACT_CHARS) {
+ issues.push({
+ code: "submission_abstract_too_long",
+ message: `${posterName}: ${submissionAbstractTooLongMessage(abstractLength)}`,
+ severity: "error",
+ sheet: sheet.name,
+ rowNumber: rowIndex + 1,
+ field: "submission_abstract",
+ posterId: row.poster_id,
+ });
+ }
+
for (const column of editable) {
</code_context>
<issue_to_address>
**Grid API saves overlong abstracts**
When a metadata-grid API caller submits a `submission_abstract` longer than 10,000 characters, a caller that bypasses the browser check can POST an abstract longer than 10,000 characters to the metadata-grid endpoint: its request schema allows cells up to 100,000 characters, and the importer persists the value without enforcing the abstract limit. The saved poster then fails strict validation.
Enforce the abstract limit in the server-side metadata-grid import path as well as in the browser.
</issue_to_address>
### Comment 5
<location path="app/components/conferences/BulkImportMetadataGridRow.vue" line_range="118" />
<code_context>
+ label="Remove poster"
+ class="mt-1 -ml-2 flex opacity-60 group-hover:opacity-100 focus-visible:opacity-100"
+ :aria-label="`Remove ${posterName} from this batch`"
+ @click="emit('removePoster', row.poster_id ?? '')"
+ />
</span>
</code_context>
<issue_to_address>
**Concurrent save partially applies edits**
When the organizer confirms removal while a metadata save covering that poster is in flight, the metadata save can read the poster before `removePostersFromBulkImportJob` deletes it, then fail when `applyPatchToPoster` updates that deleted poster. Since the save applies patches to posters concurrently, updates for other posters can already commit while the request reports failure, leaving the grid’s save result inconsistent with persisted metadata.
Serialize poster removal with metadata saves, or make the save handle posters deleted during the request without rejecting after applying only some patches.
</issue_to_address>
### Comment 6
<location path="app/components/conferences/BulkImportMetadataGrid.vue" line_range="1619" />
<code_context>
+ // A reload replaced the rows: the next load looks up the new ones.
+ const current = new Set(sheetRows.value[CREATORS_SHEET] ?? []);
+ batch.forEach((row, index) => {
+ if (!current.has(row)) return;
+ orcidLookedUp.add(personKey(row));
+ const orcid = orcids[index];
</code_context>
<issue_to_address>
**Lookup result lost during save**
When a poster is saved before its worksheet-author ORCID lookup returns, a save can reload the grid and replace the row objects while the lookup is in flight. This check then discards the result; because `onGridSaved` also removes the successfully saved poster from `posterSheetUnsaved`, the worksheet author is not looked up again and the found ORCID is lost.
Keep or retry outstanding lookup results across saves, or defer clearing the pending worksheet entry until its lookup has completed.
</issue_to_address>
### Comment 7
<location path="server/api/bulk-poster-submissions/[jobId]/staged-poster.delete.ts" line_range="41-45" />
<code_context>
+ (job?.submissionSummary as BulkImportSubmissionSummary | null)
+ ?.createdPosters ?? [];
+ // Only a draft this batch created; never another of the user's drafts.
+ if (!job || !created.some((entry) => entry.posterId === posterId)) {
+ throw createError({
+ statusCode: 404,
+ statusMessage: "Poster not found in this import",
+ });
+ }
+ const result = await removePostersFromBulkImportJob(
</code_context>
<issue_to_address>
**Retried removal reports failure**
When the server completes removal but the response is lost and the client retries the DELETE, after a successful removal, the helper removes the poster from `createdPosters`; a retried DELETE then fails this membership check with 404 instead of returning the already-removed state. If the first response was lost, the caller sees an error even though the poster was removed.
Treat a poster previously removed from this batch as an idempotent success, or return an explicit already-removed result on retry.
</issue_to_address>
### Comment 8
<location path="app/components/conferences/BulkImportMetadataGrid.vue" line_range="575" />
<code_context>
const posterName = posterDisplayName(row.poster_id ?? "");
+ const abstractLength = (row.submission_abstract ?? "").length;
+ if (abstractLength > MAX_SUBMISSION_ABSTRACT_CHARS) {
+ issues.push({
+ code: "submission_abstract_too_long",
</code_context>
<issue_to_address>
**Draft save skips abstract limit**
When a poster has an abstract longer than 10,000 characters and the organizer uses Save draft, `save()` calls `collectAllValidationIssues` with `validate: false`, and that option skips `collectGridRequiredIssues`; an over-limit abstract is therefore saved without the new grid error or warning, despite the stated pre-save limit.
Run the abstract-length check on draft saves too, separately from required-field validation, or reject over-limit abstracts in the grid-save handler.
</issue_to_address>Sourcery assessment
Needs a human reviewer. 7 findings to address first, and the new DELETE path removes a batch-created poster and its file after checking that it belongs to the user’s batch. If the wrong poster is removed, reverting the code will not restore its draft or metadata; it would need to be uploaded and recreated.
Blocking findings: shared/utils/posterSheetToGrid.ts:57, app/components/conferences/BulkImportMetadataGrid.vue:1623, server/api/bulk-poster-submissions/[jobId]/staged-poster.delete.ts:47, app/components/conferences/BulkImportMetadataGrid.vue:585, app/components/conferences/BulkImportMetadataGridRow.vue:118, and 2 more
| statusMessage: "Poster not found in this import", | ||
| }); | ||
| } | ||
| const result = await removePostersFromBulkImportJob( |
There was a problem hiding this comment.
🟡 Medium · Failed removal leaves stale batch state
When draft deletion succeeds but a subsequent Bunny or file cleanup, or job update, fails, removePostersFromBulkImportJob has already deleted the draft when the later step fails, leaving the batch’s poster or staged-file records unchanged. The request fails while the batch still references the deleted poster.
Make draft deletion and batch/file cleanup atomic, or reconcile the batch state when a later removal step fails.
Prompt for AI agents
In `server/api/bulk-poster-submissions/[jobId]/staged-poster.delete.ts` at line 47:
**Failed removal leaves stale batch state**
When draft deletion succeeds but a subsequent Bunny or file cleanup, or job update, fails, `removePostersFromBulkImportJob` has already deleted the draft when the later step fails, leaving the batch’s poster or staged-file records unchanged. The request fails while the batch still references the deleted poster.
Make draft deletion and batch/file cleanup atomic, or reconcile the batch state when a later removal step fails.| // A reload replaced the rows: the next load looks up the new ones. | ||
| const current = new Set(sheetRows.value[CREATORS_SHEET] ?? []); | ||
| batch.forEach((row, index) => { | ||
| if (!current.has(row)) return; |
There was a problem hiding this comment.
🟡 Medium · Lookup result lost during save
When a poster is saved before its worksheet-author ORCID lookup returns, a save can reload the grid and replace the row objects while the lookup is in flight. This check then discards the result; because onGridSaved also removes the successfully saved poster from posterSheetUnsaved, the worksheet author is not looked up again and the found ORCID is lost.
Keep or retry outstanding lookup results across saves, or defer clearing the pending worksheet entry until its lookup has completed.
Prompt for AI agents
In `app/components/conferences/BulkImportMetadataGrid.vue` at line 1619:
**Lookup result lost during save**
When a poster is saved before its worksheet-author ORCID lookup returns, a save can reload the grid and replace the row objects while the lookup is in flight. This check then discards the result; because `onGridSaved` also removes the successfully saved poster from `posterSheetUnsaved`, the worksheet author is not looked up again and the found ORCID is lost.
Keep or retry outstanding lookup results across saves, or defer clearing the pending worksheet entry until its lookup has completed.…poster removal - Keep word breaks when matching worksheet authors to extracted ones, so run-together names no longer pick up someone else's identifiers. - Apply background ORCID lookups by poster and the identity sent, not the row object: results survive a save's reload and are dropped when the name or affiliations changed meanwhile. - Check the submission abstract limit before every save (Save draft too) and enforce it on the server for grid saves and workbook uploads. - Skip posters removed during a grid save instead of failing part way; don't remove a poster while a save runs, or save while a removal runs. - Update the batch for whatever a removal already deleted when a later step fails, and treat a retried DELETE of a removed poster as success.
|
Thank you for getting this pull request merged. We appreciate your contribution and look forward to your next one! |
Fixes from testing the Curious sheet on staging.
Changes
POST /api/bulk-poster-submissions/[jobId]/sheet-orcid-lookup, forwarding toPOST /orcid/lookup) in the background after the sheet is applied. Found iDs fill empty ORCID cells as unsaved changes, with a toast. Cells the organizer fills meanwhile are left alone.carryIdentifiersalso matches the same full name split differently (Wendy Jansen | HolleboomandWendy | Jansen Holleboom). On 19 test posters with real extraction output, carried ORCIDs go from 73 to 75 of 85 sheet authors.keywords_added(Curious track, EasyChair topics) is added to the poster's keywords instead of replacing what extraction found. Re-applying the sheet does not repeat them.staged-posterDELETE, which now also takes aposterIdand refuses one this batch did not create. The poster's rows leave the grid without a reload, so unsaved edits to other posters stay.Notes
/orcid/lookup(posters-science-extraction-api PR to main). Without it the lookup fails quietly and the cell's Find ORCID still works.nuxi typecheck: no new errors compared with staging.Summary by Sourcery
Improve worksheet-based batch review with more reliable author identifiers, keyword merging, abstract validation, and poster removal.
New Features:
Bug Fixes: