Files
romm/backend/models
Georges-Antoine Assi c0a67d674d fix(player): record the device that wrote a state and skip other devices' states at start (#5531)
* fix(player): boot another device's save over a state from the same quit

States record no device, so the start screen could not tell a state written
by another client's core (Argosy) from one this browser wrote. When the newest
save names a device other than this browser and the newest state was written
within a few seconds of it, default to the save. This browser's own Save and
Quit still resumes from its state.

Fixes #5199

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(player): keep the newer-save warning beside a same-quit state

Addresses Greptile review on #5531: skipping a state from the picked
save's quit returned no warning even when a newer save existed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* feat(states): record the device that wrote a state

States now carry origin_device_id like saves. POST /states and
PUT /states/{id} take an optional device_id, and new content takes the
writer's device (or none when the client names none). The web player
sends this browser's device id with every state, including held ones.

The start screen no longer defaults to a state tagged with another
device. The same-quit timing rule stays only for untagged states, which
covers states stored before this change and clients that send no device.

device resolution moves from endpoints/saves.py to utils/auth.py so
both asset endpoints share it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(player): drop the same-quit timing rule for untagged states

The start screen and the newer-progress warning now go by the state's
recorded device alone: an untagged state counts as this browser's, and
a state tagged with another device is neither the default nor a reason
to warn.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* test(player): cover untagged states beside another device's save (code-review)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* refactor(player): simplify the resume fallback and repair a mis-collated state column (simplify)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* docs(states): trim the origin device column comment (review-polish)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 07:58:51 -05:00
..
2026-07-23 14:44:56 -04:00
2026-03-14 23:35:04 -04:00