Skip to content

receivedEOSE is set to true when relay sends CLOSED #395

@nogringo

Description

@nogringo

Problem

In _handleClosed, receivedEOSE is set to true when a relay sends a CLOSED message, even though no EOSE was actually received.

Why it matters

Per NIP-01:

  • EOSE = "I've sent all stored events, subscription continues"
  • CLOSED = "Subscription rejected or terminated" (auth-required, restricted, etc.)

These have different semantics. Code relying on receivedEOSE assumes the relay successfully processed the request, which is false when CLOSED is received.

Suggested fix

Add a separate flag (e.g., isTerminated or receivedClosed) instead of reusing receivedEOSE.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingtoTriage

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions