collective-soundworks / soundworks

Creative coding framework for distributed applications based on Web technologies.
http://soundworks.dev
BSD 3-Clause "New" or "Revised" License
114 stars 7 forks source link

SharedState - handle race conditions #73

Closed b-ma closed 11 months ago

b-ma commented 11 months ago
const aCreated = await server.stateManager.create('a');
const aAttached = await client.stateManager.attach('a');

await aCreated.delete();
await aAttached.detach(); // program is stuck here...

Possible fix:

Keep track of all requests and reject them if a DELETE_NOTIFICATION or a DETACH_NOTIFICATION is received