Skip to content

18.6.0: a losing concurrent queue claim answers 404 RECORD_NOT_FOUND instead of 409 CONCURRENT_UPDATE #35188

Closed as duplicate

Description

@baozhoutao

What changed

On 18.5.0, when two queue members claim the same parked record at the same time (update(object, { id, owner_id: me }, { where: { id }, context })), exactly one wins and the other gets 409 CONCURRENT_UPDATE, the answer the queue-claim design documents ("the record was taken").

On 18.6.0 the winner is still unique, but the loser gets 404 RECORD_NOT_FOUND ("This record does not exist, or you do not have access to it.").

Likely cause

18.6.0 opens a unit of work at the write door for an object with a bound before* hook (objectql changelog: "FROM … has no after* hook able to abort. The write door opened no unit of work"). The two claims are now serialized. The loser's by-id prior-row read (readUpdatePriorRow → if (!priorRecord) throw recordNotFoundError(...) in engine-update.ts) runs after the winner commits. The row is now owned and outside the loser's queue visibility, so the read finds nothing and the 404 fires before the claim precondition can answer 409.

Why it matters

The person who lost the race is told the record does not exist or they lack access, when it was simply claimed by a colleague a moment earlier. The 409 told them exactly that.

Repro

A downstream app test pins this (test/ownership-queues.test.ts, "concurrent claims leave exactly one owner, and every loser gets 409"): crm_case with ownership: 'user', queue members, and before* hooks bound. It passes on 18.5.0 and fails consistently on 18.6.0 with { code: 'RECORD_NOT_FOUND', status: 404 }.

Ask

Have a losing claim answer 409 CONCURRENT_UPDATE again. For example, when a by-id update carries a claim/write precondition and the prior read comes back empty because of visibility, answer the precondition's 409 rather than a 404.

Activity

  1. objectstack-fleet commented on Nov 18, 2026

    @objectstack-fleet
    Contributor

    triage#1 · hotlong · session_01Q4EjjMnyLqJdzuktEmRPXH

    2026-11-18T11:52Z · Closed as a duplicate of #35142. It is the same 18.6.0 regression: a losing concurrent claim answers 404 RECORD_NOT_FOUND instead of 409 CONCURRENT_UPDATE. repo:objectstack#1 holds #35142 and its fix PR #35165 is in the merge queue. Thank you for the clear report: the queue-claim repro is useful, and the fix pins exactly that case. Follow #35142 for the release that carries it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions