fix(offline): delete a finished local game from the device, not the network
CI / changes (pull_request) Successful in 2s
CI / unit (pull_request) Has been skipped
CI / integration (pull_request) Has been skipped
CI / ui (pull_request) Successful in 1m10s
CI / conformance (pull_request) Successful in 10s
CI / gate (pull_request) Successful in 0s
CI / deploy (pull_request) Successful in 1m41s
CI / changes (pull_request) Successful in 2s
CI / unit (pull_request) Has been skipped
CI / integration (pull_request) Has been skipped
CI / ui (pull_request) Successful in 1m10s
CI / conformance (pull_request) Successful in 10s
CI / gate (pull_request) Successful in 0s
CI / deploy (pull_request) Successful in 1m41s
The lobby's finished-game delete (hide) always called gateway.hideGame; for a local (offline) game the transport kill switch refused it, so it toasted and the game stayed. Route by id: a local game is removed from the device store + the source cache (LocalSource.delete), an online game still hides on the backend.
This commit is contained in:
@@ -65,6 +65,14 @@ describe('LocalSource.list', () => {
|
||||
expect(g.seats[1].accountId).not.toBe('acct-42'); // the robot keeps a synthetic id
|
||||
});
|
||||
|
||||
it('delete removes a stored local game from the list', async () => {
|
||||
const src = new LocalSource();
|
||||
await src.create(opts('local:x', 5n));
|
||||
expect((await src.list()).map((g) => g.id)).toContain('local:x');
|
||||
await src.delete('local:x');
|
||||
expect((await src.list()).map((g) => g.id)).not.toContain('local:x');
|
||||
});
|
||||
|
||||
it('reconstructs a game persisted by a previous session (not in the source cache)', async () => {
|
||||
// Seed the store via one source, then list from a fresh source whose in-memory cache is empty.
|
||||
await new LocalSource().create(opts('local:old', 7n));
|
||||
|
||||
Reference in New Issue
Block a user