mirror of
https://github.com/PR0M3TH3AN/bitvid.git
synced 2026-11-03 03:12:31 +00:00
feat(relay): add SubscriptionManager (L1) + direct-pool-access lint guard
P1 foundation of the data-flow refactor (docs/architecture-refactor.md): - js/nostr/subscriptionManager.js: the single chokepoint for relay reads. Builds on relaySubscriptionService (dedup by key) and adds: health-gated default relays, deduped one-shot list() with timeout, and a reconnect registry that re-issues active subs centrally (instead of every subsystem re-subscribing on reconnect — the storm amplifier). Callers pass batched filters (one REQ for many ids), never per-item. - Export RelaySubscriptionService class for test isolation. - scripts/check-direct-pool-access.mjs + lint:pool-access: fail on NEW direct pool.sub/list usage; 12 grandfathered files listed as migration targets (allowlist may only shrink). Nothing rewired yet — additive. Pilot (video feed) and per-subsystem migration follow. Cheat-resistant tests included. Co-Authored-By: Claude Opus 4.8 <[email protected]>
This commit is contained in:
1 parent
70aab38470
commit
1fb6b86b7f
5 files changed
+393
-3
No files matched your search
@@ -89,7 +89,7 @@ function buildSignature({ relays, filters }) {
|
||||
});
|
||||
}
|
||||
|
||||
class RelaySubscriptionService {
|
||||
export class RelaySubscriptionService {
|
||||
constructor() {
|
||||
this.subscriptions = new Map();
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user