Skip to content

Commit 351e80d

Browse files
dahliaclaude
andcommitted
Swallow errors in LogStore write chain
A single failed KvStore.set() could poison the promise chain, causing all subsequent writes and flush() to reject. It could also trigger an unhandled rejection since the synchronous Sink never awaits the result. Catch and discard errors so logging remains best-effort. #564 (comment) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 60fe35c commit 351e80d

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

packages/debugger/src/mod.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,11 @@ class LogStore {
114114
Math.random().toString(36).slice(2)
115115
}`,
116116
] as unknown as KvKey;
117-
this.#pending = this.#pending.then(() => this.#kv.set(key, record));
117+
// Errors are swallowed so a single failed write cannot poison the
118+
// chain or cause an unhandled rejection — logging is best-effort.
119+
this.#pending = this.#pending.then(
120+
() => this.#kv.set(key, record),
121+
).catch(() => {});
118122
}
119123

120124
/** Wait for all pending writes to complete. */

0 commit comments

Comments
 (0)