Socket
Socket
Sign inDemoInstall

@hocuspocus/server

Package Overview
Dependencies
Maintainers
6
Versions
114
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@hocuspocus/server - npm Package Compare versions

Comparing version 2.13.1 to 2.13.2

2

dist/packages/server/src/Hocuspocus.d.ts

@@ -92,3 +92,3 @@ /// <reference types="node" />

loadDocument(documentName: string, request: Partial<Pick<IncomingMessage, 'headers' | 'url'>>, socketId: string, connection: ConnectionConfiguration, context?: any): Promise<Document>;
storeDocumentHooks(document: Document, hookPayload: onStoreDocumentPayload): Promise<void>;
storeDocumentHooks(document: Document, hookPayload: onStoreDocumentPayload, immediately?: boolean): any;
/**

@@ -95,0 +95,0 @@ * Run the given hook on all configured extensions.

{
"name": "@hocuspocus/server",
"description": "plug & play collaboration backend",
"version": "2.13.1",
"version": "2.13.2",
"homepage": "https://hocuspocus.dev",

@@ -32,7 +32,7 @@ "keywords": [

"dependencies": {
"@hocuspocus/common": "^2.13.1",
"@hocuspocus/common": "^2.13.2",
"async-lock": "^1.3.1",
"kleur": "^4.1.4",
"lib0": "^0.2.47",
"uuid": "^9.0.0",
"uuid": "^10.0.0",
"ws": "^8.5.0"

@@ -39,0 +39,0 @@ },

@@ -45,3 +45,3 @@ import { URLSearchParams } from 'url'

transactionOrigin,
})
}, true)
}

@@ -63,3 +63,3 @@

socketId: 'server',
})
}, true)

@@ -66,0 +66,0 @@ this.document = null

@@ -381,3 +381,3 @@ import { IncomingMessage } from 'http'

*/
private handleDocumentUpdate(document: Document, connection: Connection | undefined, update: Uint8Array, request?: IncomingMessage): void {
private async handleDocumentUpdate(document: Document, connection: Connection | undefined, update: Uint8Array, request?: IncomingMessage) {
const hookPayload: onChangePayload | onStoreDocumentPayload = {

@@ -409,8 +409,3 @@ instance: this,

this.debouncer.debounce(
`onStoreDocument-${document.name}`,
() => this.storeDocumentHooks(document, hookPayload),
this.configuration.debounce,
this.configuration.maxDebounce,
)
await this.storeDocumentHooks(document, hookPayload)
}

@@ -526,22 +521,30 @@

storeDocumentHooks(document: Document, hookPayload: onStoreDocumentPayload) {
return this.hooks('onStoreDocument', hookPayload)
.then(() => {
this.hooks('afterStoreDocument', hookPayload).then(() => {
// Remove document from memory.
storeDocumentHooks(document: Document, hookPayload: onStoreDocumentPayload, immediately?: boolean) {
return this.debouncer.debounce(
`onStoreDocument-${document.name}`,
() => {
return this.hooks('onStoreDocument', hookPayload)
.then(() => {
this.hooks('afterStoreDocument', hookPayload).then(() => {
// Remove document from memory.
if (document.getConnectionsCount() > 0) {
return
}
if (document.getConnectionsCount() > 0) {
return
}
this.unloadDocument(document)
})
})
.catch(error => {
console.error('Caught error during storeDocumentHooks', error)
this.unloadDocument(document)
})
})
.catch(error => {
console.error('Caught error during storeDocumentHooks', error)
if (error?.message) {
throw error
}
})
if (error?.message) {
throw error
}
})
},
immediately ? 0 : this.configuration.debounce,
this.configuration.maxDebounce,
)
}

@@ -548,0 +551,0 @@

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

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