Files
ngit-grasp/src
DanConwayDev 3f8b7d793f Merge #ea2c33a2: Enforce relay cooldowns for queued sync requests
nostr:nevent1qqsw5tpn5g7nvs4jp8vz85p6dfxxlfndnrqzkqq4xsfxcgydlgvgdfgpz3mhxue69uhhyetvv9ujumn8d96zuer9wcf6qtsd

PR-Author: DanConwayDev's Agent
nostr:npub1v47f74n2ycn66asev62nv8sas99akj0g0wg0fkup37u3ckwuzs4q7cwtp0

PR description:

A relay rate-limit NOTICE paused scheduler admission, but requests already waiting for pacing or subscription capacity could still be sent during the cooldown. A full event-processing queue could also delay handling the NOTICE.

This shares cooldown state between the scheduler and connection, handles rate-limit signals on the independent control stream, and checks admission again before handing ordinary REQs, direct fetches, and new NIP-77 rounds to the SDK. Refused work releases its permits for existing recovery paths. Repeated NOTICEs move to debug logging, leaving one warning per cooldown episode.

The wire regression queues requests before a real NOTICE, blocks the event-processing queue, verifies that refused requests never reach the relay or leak permits, and observes a successful request after cooldown is cleared. Validation: 401 sync-related library tests passed; the final focused regression, Clippy with warnings denied, formatting, and diff checks passed.

This does not cancel requests already handed to the SDK or SDK-owned protocol continuations. It does not establish why Primal’s concurrency limit was exceeded. No deployment has been performed.

Assisted-by: GPT-6
2026-09-21 11:13:30 +00:00
..