We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e85b438 commit 4ca7393Copy full SHA for 4ca7393
src/y-socket-io/y-socket-io.js
@@ -536,7 +536,17 @@ export class YSocketIO {
536
} else {
537
await this.client.store.persistDoc(namespace, 'index', doc)
538
}
539
- await this.client.trimRoomStream(namespace, 'index')
+
540
+ /**
541
+ * there's a possibility where the namespace is deleted after the
542
+ * persist promise resolved, so we have to check if the room still
543
+ * exist.
544
+ * @see cleanupNamespace
545
+ * @see cleanupNamespaceImpl
546
+ */
547
+ if (this.namespaceMap.has(namespace)) {
548
+ await this.client.trimRoomStream(namespace, 'index')
549
+ }
550
} catch (e) {
551
console.error(e)
552
} finally {
0 commit comments