Skip to content

Commit 6553c8e

Browse files
authored
Restore recently-broken notifier: getNotifier() should succeed even if notifier is empty. (#1841)
Prior to 43faaba, getNotifier() wasn't using the hasNotifier() check, but succeeded whenever a notifier was "configured" (by adding addNotifier()), even if it was configured with the "empty notifier". This restores previous behavior. Any home server calls addNotifier(), and the updated check restores the behavior of only checking if addNotifier() has been called. ## Has this been tested? Tests have been failing since 43faaba, and should now pass.
1 parent 7256284 commit 6553c8e

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

app/server/lib/FlexServer.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -455,8 +455,9 @@ export class FlexServer implements GristServer {
455455
}
456456

457457
public getNotifier(): INotifier {
458-
// Check that our internal notifier implementation is in place.
459-
if (!this.hasNotifier()) { throw new Error('no notifier available'); }
458+
// We only warn if we are in a server that doesn't configure notifiers (i.e. not a home
459+
// server). But actually having a working notifier isn't required.
460+
if (!this._has('notifier')) { throw new Error('no notifier available'); }
460461
// Expose a wrapper around it that emits actions.
461462
return this._emitNotifier;
462463
}

0 commit comments

Comments
 (0)