From 183a756c1e257da77eca8058d51de90fd8f628fb Mon Sep 17 00:00:00 2001 From: Esteban Ordano Date: Wed, 17 Jun 2026 10:11:30 +0200 Subject: [PATCH] fix(P4K): don't report scene websocket connect failures to Sentry MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit UNITY-EXPLORER-P4K (3010 evts/7 users): Utility.Networking.WebSocketException from scene JS connect(). WebSocketApiWrapper.ConnectAsync wrapped the call in .ReportAndRethrowException(exceptionsHandler), so every failed connection to a scene-supplied (dead/invalid) endpoint became a Sentry error — a scene retry loop produced thousands. The sibling SimpleFetchApiWrapper.Fetch deliberately does not report. Drop the report from connect only; ToDisconnectedPromise still rejects the scene's JS promise so its catch handler runs. Send/Receive/Close keep reporting. Report-noise reduction, not a functional bug. Unverified (no build). Co-Authored-By: Claude Opus 4.8 (1M context) Production evidence (decentraland Sentry, archive snapshot 2026-07-17): - UNITY-EXPLORER-P4K: 94 events / 21 users, last seen 2026-07-15 - UNITY-EXPLORER-KG0: 11 events / 5 users, last seen 2026-03-15 --- .../Apis/Modules/WebSocket/WebSocketApiWrapper.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Explorer/Assets/DCL/Infrastructure/SceneRuntime/Apis/Modules/WebSocket/WebSocketApiWrapper.cs b/Explorer/Assets/DCL/Infrastructure/SceneRuntime/Apis/Modules/WebSocket/WebSocketApiWrapper.cs index ba800a7d160..5849b00da3a 100644 --- a/Explorer/Assets/DCL/Infrastructure/SceneRuntime/Apis/Modules/WebSocket/WebSocketApiWrapper.cs +++ b/Explorer/Assets/DCL/Infrastructure/SceneRuntime/Apis/Modules/WebSocket/WebSocketApiWrapper.cs @@ -49,7 +49,11 @@ public object ConnectAsync(int websocketId, string url) if (!isLocalSceneDevelopment && !url.ToLower().StartsWith("wss://")) throw new Exception("Can't start an unsafe ws connection, please upgrade to wss. url=" + url); - return api.ConnectAsync(websocketId, url, disposeCts.Token).ReportAndRethrowException(exceptionsHandler).ToDisconnectedPromise(this); + // A failed connection to a scene-supplied endpoint is a scene-content problem, not an + // explorer defect, so it must NOT be reported to Sentry as an error (it spammed + // UNITY-EXPLORER-P4K with thousands of events). ToDisconnectedPromise still rejects the + // scene's JS connect() promise, matching how SimpleFetchApiWrapper.Fetch surfaces failures. + return api.ConnectAsync(websocketId, url, disposeCts.Token).ToDisconnectedPromise(this); } catch (Exception e) {