whatwhywhenandwho-jiffy
TypeScript icon, indicating that this package has built-in type declarations

0.1.12 • Public • Published

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 😘

Readme

Keywords

none

Package Sidebar

Install

npm i whatwhywhenandwho-jiffy

Weekly Downloads

39

Version

0.1.12

License

none

Unpacked Size

83.4 kB

Total Files

79

Last publish

Collaborators

  • whatwhywhenandwho