@hocuspocus/extension-redis
Advanced tools
Comparing version 2.12.2-rc.0 to 2.12.2
@@ -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 @@ /** |
@@ -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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
137161
2661
0
Updated@hocuspocus/server@^2.12.2