fix: resolve NostrClient initialization race condition

Co-authored-by: PR0M3TH3AN <[email protected]>
This commit is contained in:
google-labs-jules[bot]andPR0M3TH3AN committed 2026-02-14 13:22:43 +00:00
1 parent a5c4b97085
commit e6a73687dd
4 files changed
+158 -33

No files matched your search

@@ -0,0 +1,15 @@
# Weekly Agent Task Complete: Race Condition Audit
- **Agent**: race-condition-agent
- **Date**: 2026-02-14
- **Cadence**: Weekly
## Summary
Audited `js/nostr/client.js` and identified a critical race condition in the initialization logic where `isInitialized` was set prematurely. Implemented a fix using the `initPromise` pattern and validated it with a new reproduction test.
## Artifacts
- **Report**: [docs/race-condition-reports/weekly-race-condition-report-2026-02-14.md](../../race-condition-reports/weekly-race-condition-report-2026-02-14.md)
- **Reproduction Test**: [tests/race/nostr-client-init-race.test.mjs](../../../../tests/race/nostr-client-init-race.test.mjs)
## Next Steps
- Monitor Sentry for `Cannot read properties of null` errors related to pool access.