mirror of
https://github.com/block/buzz.git
synced 2026-11-28 12:12:04 +00:00
fix(nip-rs): add fencedLoader integration and manager/storage fixes
Companion to previous commit (fencedLoader new file). Integrates the new fencedEnumerationLoad into readStateManager and closes the remaining Thufir pass-1 findings: readStateManager.ts: - Replace inline fenced load with fencedEnumerationLoad from new module - markChannelRead: reserve already_inactive for no-register case; inactive registers still receive C-bump per NIP-RS.md:537-539 - Remove unused imports readStateStorage.ts: - writeStoredReadState returns boolean (false if any localStorage write throws) - Callers (markChannelUnread, markChannelRead) surface storage_failed on false relayClientSession.ts: - Add getConnectionGeneration() getter (net-zero line count) readStateManager.test.mjs: - Add subscribeToReconnects/getConnectionGeneration to all fakeRelay stubs - Live override test: use real initialize() + 50ms wait for void handler - Budget test: deterministic split-success and refusal witnesses - New tests 8-11: storage failure, inactive C-bump, coord dedupe, lapse readStateStorage.test.mjs: - Assert writeStoredReadState returns false when setItem throws Co-authored-by: Will Pfleger <pfleger.will@gmail.com> Signed-off-by: Will Pfleger <pfleger.will@gmail.com>
This commit is contained in:
parent
c11a0cc8fe
commit
e5bdaa9804
@@ -448,17 +448,17 @@ export class RelayClient {
|
||||
|
||||
subscribeToReconnects(listener: () => void) {
|
||||
this.reconnectListeners.add(listener);
|
||||
|
||||
return () => {
|
||||
this.reconnectListeners.delete(listener);
|
||||
};
|
||||
}
|
||||
|
||||
getConnectionGeneration(): number {
|
||||
return this.connectionGeneration;
|
||||
}
|
||||
/** Current connection state — synchronous read. */
|
||||
getConnectionState(): ConnectionState {
|
||||
return this.connectionStateEmitter.get();
|
||||
}
|
||||
|
||||
/**
|
||||
* Subscribe to connection-state transitions. The listener is invoked
|
||||
* immediately with the current state so callers don't need a separate
|
||||
|
||||
Reference in New Issue
Block a user