whatwhywhenandwho-jiffy
v0.1.12
Published
## WebSockets
Readme
jiffy
WebSockets
Edge case: sending deletion and/or creation signals on update
This happens when entity gets updated, but is considered deleted due to a failed check.
Consider the following example of an arbitrary entity, that defines user access to it via the access array:
{
deleted: false,
access: [{
userId: '<uuid>',
deleted: false
}]
}Consider flipping the only access child's deleted to true. From the user's perspective, the top level entity doesn't exist anymore, so we send a deleted signal.
Later, the entity gets updated again, flipping the only access child's deleted back to false. From the user's perspective, the top level entity exist again, however, we cannot know this in WebSocketServer, because there might be no subscription. To address this, we also send all the creation signals.
Have a nice day 😘
