Guard reindex rollback against newer jobs
When overlapping full reindex requests hit this path and this request's job insert fails after another request has already enqueued or a worker has started a replacement job, this rollback writes the pre-queue document snapshot back using only id/owner_id. checkIngestionMutationSafety runs before this window and only inspects existing jobs, so it does not prevent a later pending/processing job from being clobbered back to the old failed status/counts; make the rollback conditional on the document still matching this request's queued/reset state or move the document update and job insert into one transaction/RPC.
Useful? React with 👍 / 👎.
Originally posted by @chatgpt-codex-connector[bot] in #146 (comment)
When overlapping full reindex requests hit this path and this request's job insert fails after another request has already enqueued or a worker has started a replacement job, this rollback writes the pre-queue document snapshot back using only
id/owner_id.checkIngestionMutationSafetyruns before this window and only inspects existing jobs, so it does not prevent a later pending/processing job from being clobbered back to the old failed status/counts; make the rollback conditional on the document still matching this request's queued/reset state or move the document update and job insert into one transaction/RPC.Useful? React with 👍 / 👎.
Originally posted by @chatgpt-codex-connector[bot] in #146 (comment)