@secondlayer/shared 11.11.0 → 11.11.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -9,16 +9,24 @@ interface ListenOptions {
9
9
  }
10
10
  /**
11
11
  * LISTEN/NOTIFY connection for indexer-fired channels (`indexer:new_block`,
12
- * `subgraph_reorg`, `tx:confirmed`) — they fire on the SOURCE (chain) DB.
13
- * `||` (not `??`) so an empty-string env (an unset `SOURCE_DATABASE_URL` passed
14
- * through docker-compose as `""`) falls back to `DATABASE_URL`.
12
+ * `subgraph_reorg`, `tx:confirmed`, `index:tip`) — they fire wherever
13
+ * `getSourceDb()` writes. Delegates to `resolveSourceUrl` (the same function
14
+ * `getSourceDb()` calls) instead of re-deriving the env-var precedence here:
15
+ * a hand-duplicated resolver previously skipped the `isPlatformMode()` gate
16
+ * that `getSourceDb()` applies, so a process not in platform mode (but with
17
+ * `SOURCE_DATABASE_URL` set anyway, e.g. inherited from a shared env
18
+ * template) would LISTEN on a different database than the one the write
19
+ * actually commits to — a NOTIFY that fires correctly on the writer's
20
+ * connection then never reaches this listener. One resolver, used by both.
15
21
  */
16
- declare function sourceListenerUrl(): string | undefined;
22
+ declare function sourceListenerUrl(): string;
17
23
  /**
18
24
  * LISTEN/NOTIFY connection for control-plane channels (`webhooks:new_outbox`,
19
- * `webhooks:changed`, subgraph operations) — they fire on the TARGET DB.
25
+ * `webhooks:changed`, subgraph operations) — they fire wherever `getTargetDb()`
26
+ * writes. See {@link sourceListenerUrl} for why this delegates instead of
27
+ * re-deriving the precedence.
20
28
  */
21
- declare function targetListenerUrl(): string | undefined;
29
+ declare function targetListenerUrl(): string;
22
30
  declare function listen(channel: string, callback: (payload?: string) => void, opts?: ListenOptions): Promise<() => Promise<void>>;
23
31
  /** A shareable wake point: any number of callers can `wait()` for the next
24
32
  * NOTIFY on `channel`, each getting their own promise. One LISTEN connection