Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

y-websocket

Package Overview
Dependencies
Maintainers
1
Versions
59
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

y-websocket - npm Package Compare versions

Comparing version 1.0.6 to 1.0.7

9

dist/y-websocket.js

@@ -233,13 +233,10 @@ 'use strict';

this._awarenessUpdateHandler = ({ added, updated, removed }, origin) => {
const changedClients = added.concat(updated).concat(removed);
const encoder = encoding.createEncoder();
encoding.writeVarUint(encoder, messageAwareness);
encoding.writeVarUint8Array(encoder, awarenessProtocol.encodeAwarenessUpdate(awareness, [doc.clientID]));
encoding.writeVarUint8Array(encoder, awarenessProtocol.encodeAwarenessUpdate(awareness, changedClients));
broadcastMessage(this, encoding.toUint8Array(encoder));
};
window.addEventListener('beforeunload', () => {
// broadcast message with local awareness state set to null (indicating disconnect)
const encoder = encoding.createEncoder();
encoding.writeVarUint(encoder, messageAwareness);
encoding.writeVarUint8Array(encoder, awarenessProtocol.encodeAwarenessUpdate(this.awareness, [this.doc.clientID], new Map()));
broadcastMessage(this, encoding.toUint8Array(encoder));
awarenessProtocol.removeAwarenessStates(this.awareness, [doc.clientID], 'window unload');
});

@@ -246,0 +243,0 @@ awareness.on('change', this._awarenessUpdateHandler);

{
"name": "y-websocket",
"version": "1.0.6",
"version": "1.0.7",
"description": "Websockets provider for Yjs",

@@ -5,0 +5,0 @@ "main": "./dist/y-websocket.js",

@@ -235,13 +235,10 @@ /*

this._awarenessUpdateHandler = ({ added, updated, removed }, origin) => {
const changedClients = added.concat(updated).concat(removed)
const encoder = encoding.createEncoder()
encoding.writeVarUint(encoder, messageAwareness)
encoding.writeVarUint8Array(encoder, awarenessProtocol.encodeAwarenessUpdate(awareness, [doc.clientID]))
encoding.writeVarUint8Array(encoder, awarenessProtocol.encodeAwarenessUpdate(awareness, changedClients))
broadcastMessage(this, encoding.toUint8Array(encoder))
}
window.addEventListener('beforeunload', () => {
// broadcast message with local awareness state set to null (indicating disconnect)
const encoder = encoding.createEncoder()
encoding.writeVarUint(encoder, messageAwareness)
encoding.writeVarUint8Array(encoder, awarenessProtocol.encodeAwarenessUpdate(this.awareness, [this.doc.clientID], new Map()))
broadcastMessage(this, encoding.toUint8Array(encoder))
awarenessProtocol.removeAwarenessStates(this.awareness, [doc.clientID], 'window unload')
})

@@ -248,0 +245,0 @@ awareness.on('change', this._awarenessUpdateHandler)

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc