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

@hocuspocus/extension-redis

Package Overview
Dependencies
Maintainers
5
Versions
119
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@hocuspocus/extension-redis - npm Package Compare versions

Comparing version 2.12.2-rc.0 to 2.12.2

9

dist/hocuspocus-redis.esm.js

@@ -179,3 +179,3 @@ import RedisClient from 'ioredis';

*/
async afterStoreDocument({ documentName }) {
async afterStoreDocument({ documentName, socketId }) {
var _a;

@@ -188,2 +188,9 @@ (_a = this.locks.get(this.lockKey(documentName))) === null || _a === void 0 ? void 0 : _a.unlock().catch(() => {

});
// if the change was initiated by a directConnection, we need to delay this hook to make sure sync can finish first.
// for provider connections, this usually happens in the onDisconnect hook
if (socketId === 'server') {
await new Promise(resolve => {
setTimeout(() => resolve(''), this.configuration.disconnectDelay);
});
}
}

@@ -190,0 +197,0 @@ /**

2

dist/packages/extension-redis/src/Redis.d.ts

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

*/
afterStoreDocument({ documentName }: afterStoreDocumentPayload): Promise<void>;
afterStoreDocument({ documentName, socketId }: afterStoreDocumentPayload): Promise<void>;
/**

@@ -99,0 +99,0 @@ * Handle awareness update messages received directly by this Hocuspocus instance.

{
"name": "@hocuspocus/extension-redis",
"version": "2.12.2-rc.0",
"version": "2.12.2",
"description": "Scale Hocuspocus horizontally with Redis",

@@ -36,3 +36,3 @@ "homepage": "https://hocuspocus.dev",

"dependencies": {
"@hocuspocus/server": "^2.12.2-rc.0",
"@hocuspocus/server": "^2.12.2",
"ioredis": "^4.28.2",

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

@@ -246,3 +246,3 @@ import RedisClient, { ClusterNode, ClusterOptions, RedisOptions } from 'ioredis'

*/
async afterStoreDocument({ documentName }: afterStoreDocumentPayload) {
async afterStoreDocument({ documentName, socketId }: afterStoreDocumentPayload) {
this.locks.get(this.lockKey(documentName))?.unlock()

@@ -256,2 +256,10 @@ .catch(() => {

})
// if the change was initiated by a directConnection, we need to delay this hook to make sure sync can finish first.
// for provider connections, this usually happens in the onDisconnect hook
if (socketId === 'server') {
await new Promise(resolve => {
setTimeout(() => resolve(''), this.configuration.disconnectDelay)
})
}
}

@@ -258,0 +266,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 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