fix: stamp updated_by on bulk tag edits and background reclassification - #3261
Open
claudiaboldis wants to merge 1 commit into
Open
fix: stamp updated_by on bulk tag edits and background reclassification#3261claudiaboldis wants to merge 1 commit into
claudiaboldis wants to merge 1 commit into
Conversation
Bulk tag assign/remove (bulk-tags-job.js) dropped callerId on the floor between the request handler and the enqueued job, and the worker mutated prompt tags via updatePromptTagsByIds with no authorship-stamping call at all. Background reclassification (classify-prompts-job.js) had the same gap when patching a prompt's tags to inject its resolved intent value. Both now thread callerId through job metadata and follow the same best-effort stamp pattern already used by the CSV-import edit path (applyUpsertTagWrites in prompts.js): the tag write is the point of the operation, so a failed authorship stamp is logged, not fatal. Found while investigating a separate historical updated_by null-count question (pre-brandalf migration prompts) — these two are a distinct, live gap on the edit side, not a historical one.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
claudiaboldis
temporarily deployed
to
dev-branches
September 10, 2026 17:21 — with
GitHub Actions
Inactive
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.
Summary
Two live prompt-tag-mutation paths never stamp
updated_by/updated_at, leaving the field pointing at whoever created the prompt (orunknown) even after a real edit:bulk-tags-job.js):callerIdreached the request handler (acceptParsedBulkTags) but was never included in the job metadata sent tocreateAndEnqueueJob. The worker (bulkTagsHandler) then mutated tags viaupdatePromptTagsByIdswith no authorship-stamping call anywhere.classify-prompts-job.js,reclassifyExisting): same shape — patches a prompt's tags (to inject its resolvedintentvalue) viaupdatePromptTagsByIds, no stamp call, and the self-requeue chain (requeuePending) didn't carrycallerIdforward either.Both now thread
callerIdthrough job metadata and, after a successful tag write, make the same best-effort authorship-stamp call the CSV-import edit path already uses (buildUpdateMetadata+patchPromptsMetadataBatch, seeapplyUpsertTagWritesinprompts.js): the tag write is the point of the operation, so a failed stamp is logged, not fatal — it must never discard tag changes the caller already got a successful response for.Found while investigating a separate, historical
updated_bynull-count question (pre-brandalf migration prompts — unrelated, one-time gap). These two are a distinct, live gap on the edit side.Changes
src/support/serenity/handlers/bulk-tags-job.js: enqueuecallerIdin job metadata; worker stamps authorship on every prompt it actually updates.src/support/serenity/handlers/classify-prompts-job.js:requeuePendingtakes and forwardscallerId;reclassifyExistingreads it (default'unknown'for jobs enqueued before this existed), stamps authorship per project after a successful tag patch, and carriescallerIdinto any further self-requeue.Test plan
npx eslintclean on all four changed filesbulk-tags-job.test.js+classify-prompts-job.test.js): 46/46 passingnpm test(lint + full suite + coverage thresholds): passingIntroduced by: N/A