Skip to content

Conversation

EliavLunar
Copy link

Fixes #155

Problem
The proxy would fail transferring server-initiated messages (like ping) to end-client as it tried to access properties on an undefined originalRequest, assuming all requests arrived from end-client originally (which is not necessarily true, e.g. the case of server-initiated pings).

Solution
Added an early return in interceptResponse (src/lib/utils.ts) when no matching request exists in pendingRequests, allowing these messages to pass through safely.

Testing
Added tests to verify the proxy correctly handles:

  • Server-initiated requests (e.g., ping messages)
  • Orphaned responses without matching client requests (not supposed to happen, but this is another way to look at this fix)

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