Skip to content

agent: report PRXY broker errors as proxy-to-relay errors - #1842

Merged
epoberezkin merged 3 commits into
simplex-chat:masterfrom
Narasimha-sc:nd/proxy-relay-error
Aug 6, 2026
Merged

agent: report PRXY broker errors as proxy-to-relay errors#1842
epoberezkin merged 3 commits into
simplex-chat:masterfrom
Narasimha-sc:nd/proxy-relay-error

Conversation

@Narasimha-sc

@Narasimha-sc Narasimha-sc commented Aug 5, 2026

Copy link
Copy Markdown
Collaborator

With private routing enabled, a failure to reach the destination relay is reported as "Error connecting to forwarding server ", blaming a server the client connected to successfully; retrying just names the next preset server.

The proxy returns PROXY (BROKER ...) only when it fails to reach the relay, but PRXY responses were mapped to SMP <proxy> (PROXY ...) (Agent/Client.hs:713), discarding the relay address, so both clients read them as client-to-proxy failures.

This maps that one class to PROXY {proxyServer, relayServer, ...} — the shape PFWD errors already use — so the existing client alerts name both servers with no app change. Rationale, guard width and blast radius in plans/2026-08-05-proxy-relay-error-attribution.md.

The proxy returns PROXY BROKER errors only when it fails to connect to the
destination relay, but for PRXY they were mapped to SMP <proxy> (PROXY ...),
losing the relay address, so the clients reported them as errors of the
connection to the forwarding server. Map them to PROXY {proxyServer,
relayServer, ...}, the same shape PFWD errors already use.
@Narasimha-sc
Narasimha-sc force-pushed the nd/proxy-relay-error branch from eded5f4 to ac778a0 Compare August 5, 2026 17:56
@Narasimha-sc Narasimha-sc changed the title agent: report PRXY errors as proxy-to-relay errors agent: report PRXY broker errors as proxy-to-relay errors Aug 5, 2026
@Narasimha-sc
Narasimha-sc marked this pull request as draft August 5, 2026 21:34
Comment thread src/Simplex/Messaging/Agent/Client.hs
epoberezkin and others added 2 commits August 5, 2026 22:45
Reverts 826a237.

ProxyResponseError wraps PCEResponseError, a response that failed to
parse, and both clients match protocolError when rendering this error,
so the connect alert falls through to the raw error dump - and released
clients cannot render it at all. temporaryAgentError and serverHostError
also match ProxyProtocolError only, so the failure stops being retried
and proxy fallback no longer engages.
@Narasimha-sc
Narasimha-sc marked this pull request as ready for review August 6, 2026 11:16
@epoberezkin
epoberezkin merged commit 33c458f into simplex-chat:master Aug 6, 2026
3 of 6 checks passed
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.

2 participants