New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@hocuspocus/server

Package Overview
Dependencies
Maintainers
7
Versions
120
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.15.0 to 2.15.1-rc.0

2

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

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

hooks<T extends HookName>(name: T, payload: HookPayloadByName[T], callback?: Function | null): Promise<any>;
unloadDocument(document: Document): void;
unloadDocument(document: Document): Promise<any>;
enableDebugging(): void;

@@ -101,0 +101,0 @@ enableMessageLogging(): void;

@@ -1,3 +0,3 @@

import { HocuspocusProvider, HocuspocusProviderConfiguration, HocuspocusProviderWebsocketConfiguration } from '@hocuspocus/provider';
import { HocuspocusProvider, HocuspocusProviderConfiguration, HocuspocusProviderWebsocket, HocuspocusProviderWebsocketConfiguration } from '@hocuspocus/provider';
import { Hocuspocus } from '@hocuspocus/server';
export declare const newHocuspocusProvider: (server: Hocuspocus, options?: Partial<HocuspocusProviderConfiguration>, websocketOptions?: Partial<HocuspocusProviderWebsocketConfiguration>) => HocuspocusProvider;
export declare const newHocuspocusProvider: (server: Hocuspocus, options?: Partial<HocuspocusProviderConfiguration>, websocketOptions?: Partial<HocuspocusProviderWebsocketConfiguration>, websocketProvider?: HocuspocusProviderWebsocket) => HocuspocusProvider;
{
"name": "@hocuspocus/server",
"description": "plug & play collaboration backend",
"version": "2.15.0",
"version": "2.15.1-rc.0",
"homepage": "https://hocuspocus.dev",

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

"dependencies": {
"@hocuspocus/common": "^2.15.0",
"@hocuspocus/common": "^2.15.1-rc.0",
"async-lock": "^1.3.1",

@@ -35,0 +35,0 @@ "kleur": "^4.1.4",

@@ -277,6 +277,13 @@ import { IncomingMessage } from 'http'

getConnectionsCount(): number {
return Array.from(this.documents.values()).reduce((acc, document) => {
acc += document.getConnectionsCount()
return acc
const uniqueSocketIds = new Set<string>()
const totalDirectConnections = Array.from(this.documents.values()).reduce((acc, document) => {
// Accumulate unique socket IDs
document.getConnections().forEach(({ socketId }) => {
uniqueSocketIds.add(socketId)
})
// Accumulate direct connections
return acc + document.directConnectionsCount
}, 0)
// Return the sum of unique socket IDs and direct connections
return uniqueSocketIds.size + totalDirectConnections
}

@@ -527,3 +534,3 @@

.then(() => {
this.hooks('afterStoreDocument', hookPayload).then(() => {
this.hooks('afterStoreDocument', hookPayload).then(async () => {
// Remove document from memory.

@@ -535,3 +542,3 @@

this.unloadDocument(document)
await this.unloadDocument(document)
})

@@ -588,3 +595,3 @@ })

unloadDocument(document: Document) {
async unloadDocument(document: Document): Promise<any> {
const documentName = document.name

@@ -595,3 +602,3 @@ if (!this.documents.has(documentName)) return

document.destroy()
this.hooks('afterUnloadDocument', { instance: this, documentName })
await this.hooks('afterUnloadDocument', { instance: this, documentName })
}

@@ -598,0 +605,0 @@

@@ -68,3 +68,3 @@ import * as decoding from 'lib0/decoding'

applyAwarenessUpdate(document.awareness, message.readVarUint8Array(), connection)
applyAwarenessUpdate(document.awareness, message.readVarUint8Array(), connection?.webSocket)

@@ -71,0 +71,0 @@ break

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