Skip to content

fix(ws): null-safe relay URI logging + 2.0.1 release#523

Merged
tcheeric merged 3 commits into
mainfrom
fix/relay-uri-final-field-2026-05-06
May 6, 2026
Merged

fix(ws): null-safe relay URI logging + 2.0.1 release#523
tcheeric merged 3 commits into
mainfrom
fix/relay-uri-final-field-2026-05-06

Conversation

@tcheeric
Copy link
Copy Markdown
Owner

@tcheeric tcheeric commented May 6, 2026

Summary

  • NostrRelayClient was logging Sending request to relay null: … (188 occurrences in a 2-hour window of staging logs) because the log statement read clientSession.getUri(), which returns null once the WebSocket session has closed.
  • Fix: capture the URI in a private final String relayUri set in each constructor; replace 8 clientSession.getUri() log call-sites.
  • Bump version 2.0.0 → 2.0.1.

Background

Surfaced during investigation of staging incident as_1e9d265bf1c24d04 (2026-05-05). Full analysis lives in the consumer repo at imani-apps/docs/analysis-gateway-core-relay-client-circuitbreaker-2026-05-06.md. The original §2 recommendation (singleton-per-relay refactor) turned out to be a no-op — the multiplexing is already in place. The §4 fix in this PR stands on its own merits.

Test plan

  • ./mvnw -pl nostr-java-client test — 13 tests pass locally.
  • CI passes on this PR.
  • Verify no to relay null log lines in staging after imani-bom bumps to 2.0.1 and downstream services redeploy.

🤖 Generated with Claude Code

tcheeric and others added 2 commits May 6, 2026 20:22
NostrRelayClient previously logged via clientSession.getUri(), which
can return null after the WebSocket session has been closed. In
staging, this surfaced as 188 occurrences in 2 hours of:

    Sending request to relay null: ["CLOSE","sub-..."]

Capture the relay URI at construction time and store it in a
final field. Use that field for all logging instead of querying
the session, so log messages remain meaningful regardless of session
state. The package-private (WebSocketSession, long) constructor used
by tests still attempts to derive the URI from the session.

No behaviour change beyond logging; all 13 nostr-java-client tests
still pass.

Refs: docs/analysis-gateway-core-relay-client-circuitbreaker-2026-05-06.md §4

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Includes the relayUri null-safety fix from 4cdd556.
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ae14d8deab

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread pom.xml
Addresses Codex review on PR #523 — repository's AGENTS.md guideline
requires CHANGELOG.md updates for every version bump.
@tcheeric tcheeric merged commit 27612c7 into main May 6, 2026
5 checks passed
@tcheeric tcheeric deleted the fix/relay-uri-final-field-2026-05-06 branch May 6, 2026 19:44
@tcheeric tcheeric restored the fix/relay-uri-final-field-2026-05-06 branch May 6, 2026 19:44
@tcheeric tcheeric deleted the fix/relay-uri-final-field-2026-05-06 branch May 6, 2026 19:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant