Skip to content

WebSocket GET operations hang when contract not found instead of returning error #1676

Open
@sanity

Description

@sanity

Summary

When a WebSocket client sends a GET request for a non-existent contract, the operation completes internally with a failure but no response is sent back to the client, causing it to hang indefinitely.

Steps to Reproduce

  1. Connect to Freenet WebSocket API: ws://localhost:50509/v1/contract/command?encodingProtocol=native
  2. Send GET request for non-existent contract using freenet-stdlib
  3. Client hangs indefinitely waiting for response

Expected Behavior

Client should receive an error response indicating the contract was not found.

Actual Behavior

  • Freenet logs show: Failed getting a value for contract..., reached max retries
  • Freenet logs show: No operation result found
  • Client never receives any response and hangs

Root Cause

After a GET operation fails with max retries, the WebSocket layer doesn't send an error response to the client. The operation state shows "No operation result found" instead of forwarding the failure.

Impact

  • Affects River chat invitations (clients hang at "Subscribing to room...")
  • Affects any WebSocket API users requesting non-existent contracts
  • Integration tests are unaffected because they use isolated networks

Fix Location

The bug appears to be in the WebSocket response handling after GET operation failure, likely in:

  • crates/core/src/client_events/websocket.rs
  • GET operation completion handling

Transaction Details

Example failing transaction: 01JY2JF51NNJSPDGY321PACBG2

  • SeekNode sent successfully
  • ReturnGet received from peer
  • Operation failed with max retries
  • No response sent to WebSocket client

Generated with Claude Code

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    Triage

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions