# Mirror the server's turn-id guard when settling · pingdotgg/t3code

[View on GitCafe](https://git.cafe/pingdotgg/t3code/commit/dba56bafa3119833e0497177defcb8760f6ddd21)

Repository: [pingdotgg/t3code](https://git.cafe/pingdotgg/t3code)

Visibility: public

Requested revision: dba56bafa3119833e0497177defcb8760f6ddd21

Requested commit: dba56bafa3119833e0497177defcb8760f6ddd21

Commit: dba56bafa3119833e0497177defcb8760f6ddd21

Tree: e251f5f6d7f8da021f2435cbe234d2ed6b43bf99

Author: Theo Browne

Committer: Theo Browne

## Message

```
Mirror the server's turn-id guard when settling

Self-review of the settle path, which has been the source of every
regression in this branch. The server filters `turnId !== null &&
state === "running"` before settling; this filtered only on state.

No row is both null-id and running today — the sole null-id insert
writes 'pending' — so this changes no behavior. It is the invariant the
UPDATE already depends on, written down where it is relied upon, and it
keeps the two predicates directly comparable if a null-id running row
ever becomes possible.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

```

## Parents

- [c92ad95fe3e6ce86937ded61a2b63954c364a967](https://git.cafe/pingdotgg/t3code/commit/c92ad95fe3e6ce86937ded61a2b63954c364a967?format=markdown)

[Source at this commit](https://git.cafe/pingdotgg/t3code/tree/dba56bafa3119833e0497177defcb8760f6ddd21?format=markdown)
