{"record":{"id":"c75ba21fb9911ea6","repo":"clockworklabs/SpacetimeDB","slug":"reducer-result-for-unknown-request-id-reducerresu","errorCode":null,"errorMessage":"Reducer result for unknown request_id {reducerResult.RequestId}","messagePattern":"Reducer result for unknown request_id (.+?)","errorType":"exception","errorClass":"InvalidOperationException","httpStatus":null,"severity":"error","filePath":"sdks/csharp/src/SpacetimeDBClient.cs","lineNumber":553,"sourceCode":"                        {\n                            try\n                            {\n                                reducerEvent = new(\n                                    (DateTimeOffset)reducerResult.Timestamp,\n                                    reducerStatus,\n                                    Identity ?? throw new InvalidOperationException(\"Identity not set\"),\n                                    ConnectionId,\n                                    null,\n                                    pendingReducer.Reducer);\n                            }\n                            catch (Exception)\n                            {\n                                // The local reducer request still completed; failure here should not block update apply.\n                            }\n                        }\n                        else\n                        {\n                            throw new InvalidOperationException(\n                                $\"Reducer result for unknown request_id {reducerResult.RequestId}\"\n                            );\n                        }\n                        break;\n                    case ServerMessage.ProcedureResult(var procedureResult):\n                        procedureEvent = new ProcedureEvent(\n                            procedureResult.Timestamp,\n                            procedureResult.Status,\n                            Identity ?? throw new InvalidOperationException(\"Identity not set\"),\n                            ConnectionId,\n                            procedureResult.TotalHostExecutionDuration,\n                            procedureResult.RequestId\n                        );\n\n                        if (!stats.ProcedureRequestTracker.FinishTrackingRequest(procedureResult.RequestId, unparsed.timestamp))\n                        {\n                            Log.Warn($\"Failed to finish tracking procedure request: {procedureResult.RequestId}\");\n                        }","sourceCodeStart":535,"sourceCodeEnd":571,"githubUrl":"https://github.com/clockworklabs/SpacetimeDB/blob/524b4487d949b61a07d4f39c862d1290259dfd20/sdks/csharp/src/SpacetimeDBClient.cs#L535-L571","documentation":"Every reducer call is tracked client-side in pendingReducerCalls under a request id. When a ReducerResult arrives whose request id is not in that map, the parse thread throws InvalidOperationException. The parse loop's catch-all logs the exception, fails pending operations and disconnects, so users see this as a dropped connection with the message in the log.","triggerScenarios":"Server/client desync of the request-id space: a reconnect while the server still had in-flight reducer calls, duplicated or replayed ReducerResult delivery, or SDK/server version mismatch changing protocol bookkeeping.","commonSituations":"Custom reconnect logic re-driving one DbConnection after a network blip; flaky mobile networks causing duplicate frames; preview-channel server against a released SDK.","solutions":["Update the C# SDK to the version matching your server release","After a disconnect, build a fresh connection via a new builder rather than resuming the old one","Implement OnDisconnect handling that reconnects with backoff so the desync recovers automatically","If it reproduces on matched versions, attach full client logs and file a SpacetimeDB issue"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":["Handle OnDisconnect by rebuilding a fresh connection with backoff","Do not re-drive a connection object after a network failure; rebuild it","Run client SDK and server at matched released versions"],"tags":["reducer","request-tracking","reconnect","csharp"],"backgroundTag":"unknown-request-id","analyzedSha":"524b4487d949b61a07d4f39c862d1290259dfd20","analyzedAt":"2026-08-16T23:58:54.611Z","schemaVersion":2},"datasetVersion":"2026-08-17T04:17:16.089Z"}