Archived
The session.created global event (added with spawn_session) could arrive in the initiating tab before the start request's HTTP response resolved. applyCreatedSession inserted a plain session row (archive/reload actions) and then startSession unconditionally prepended the cached version (delete action), leaving two badges with the same id. Make the optimistic insert idempotent by filtering out any existing entry with the same id before prepending the cached session, so the locally cached session always wins regardless of event ordering.
496 B
496 B
@jmfederico/pi-web
| @jmfederico/pi-web |
|---|
| patch |
Fix a duplicate session appearing in the list when starting a new session. The session.created broadcast (added with the spawn_session tool) could race ahead of the start request's HTTP response in the same tab, leaving two badges with the same id — one with archive/reload actions and one with delete. The optimistic insert now replaces any entry the broadcast added, so the locally cached session (with its delete action and draft support) always wins.