Personal Telegram developer console for GitHub
fix(hardening): keep test instances isolated without durable binding
davoodmehraban89 committed
Oct 5, 2026 at 16:12 UTC
a499f1ea16c4e5b0226575a98bc074eb1d6487b2
1 file changed
+2
-1
src/core/kill-switch-store.js
+2
-1
@@ -1,7 +1,8 @@
1
export class DurableKillSwitchStoreClient {
2
constructor({ namespace } = {}) { this.namespace = namespace || null; }
3
+ isConfigured() { return Boolean(this.namespace && typeof this.namespace.idFromName === 'function' && typeof this.namespace.get === 'function'); }
4
#stub() {
4
- if (!this.namespace || typeof this.namespace.idFromName !== 'function' || typeof this.namespace.get !== 'function') throw new Error('Kill switch durable store is not configured');
5
+ if (!this.isConfigured()) throw new Error('Kill switch durable store is not configured');
6
return this.namespace.get(this.namespace.idFromName('global-emergency-kill-switch'));
7
}
8
async get() {