{"record":{"id":"b448817df50f31cb","repo":"EpicGames/lore","slug":"clientidentify-must-be-handled-successfully","errorCode":null,"errorMessage":"ClientIdentify must be handled successfully","messagePattern":"ClientIdentify must be handled successfully","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"lore-server/src/quic/storage_service_v4.rs","lineNumber":591,"sourceCode":"\n    #[tokio::test]\n    async fn run_request_handler_client_identify_returns_empty_ok() {\n        let (immutable_store, mutable_store, _exec) =\n            test_store_create().await.expect(\"Failed to create stores\");\n        let service = make_service(immutable_store, mutable_store);\n\n        let ci = crate::protocol::client_identify::ClientIdentify {\n            user_agent: Some(\"my-client/1.0\".to_string()),\n            is_trusted: false,\n        };\n\n        let response = service\n            .run_request_handler(\n                Arc::new(AttributeMap::default()),\n                ParsedStorageRequestV4::ClientIdentify(ci),\n            )\n            .await\n            .expect(\"ClientIdentify must be handled successfully\");\n\n        assert!(response.is_empty(), \"expected empty response vec\");\n    }\n\n    /// Fill the session map to capacity then attempt one more `AuthorizeStart`,\n    /// verifying the handler returns `SlowDown` and that `transform_protocol_error`\n    /// classifies it the same way `stream_handler` would.\n    #[tokio::test]\n    async fn authorize_start_returns_slow_down_when_session_limit_reached() {\n        let (immutable_store, mutable_store, _execution) =\n            test_store_create().await.expect(\"Failed to create stores\");\n\n        let service = make_service(immutable_store, mutable_store);\n\n        let repo = random::<lore_revision::lore::RepositoryId>();\n\n        // Fill the session map to capacity via the handler (jwt_verifier is None,\n        // so each call goes straight to session_map.start with no I/O).","sourceCodeStart":573,"sourceCodeEnd":609,"githubUrl":"https://github.com/EpicGames/lore/blob/074eb0b0d1194c997d7cf28b55519e3e197b3e23/lore-server/src/quic/storage_service_v4.rs#L573-L609","documentation":"A Rust test panic from `.expect(\"ClientIdentify must be handled successfully\")` on `StorageServiceV4::run_request_handler` in `run_request_handler_client_identify_returns_empty_ok` (lore-server/src/quic/storage_service_v4.rs:591). A `ParsedStorageRequestV4::ClientIdentify` request was passed to the handler and it returned a `MessageHandleError` instead of an empty success response. The handler must accept ClientIdentify (record user-agent, optionally is_trusted) and return an empty Vec; any Err here means the handler branch is missing, errors on validation, or a dependency it touches (jwt verifier, session map, attribute map) fails.","triggerScenarios":"Calling `service.run_request_handler(Arc::new(AttributeMap::default()), ParsedStorageRequestV4::ClientIdentify(ci)).await` with `ci = ClientIdentify { user_agent: Some(\"my-client/1.0\"), is_trusted: false }` and the handler returns Err — no ClientIdentify match arm in `run_request_handler`, the arm falls through to a generic error path, or the handler requires session/context state absent from the default AttributeMap.","commonSituations":"Hit while implementing the ClientIdentify handler (branch not yet added), after `is_trusted` handling was added and now requires a trusted-client allowlist that rejects untrusted clients, or when the handler signature changed from `AttributeMap` to `Arc<AttributeMap>` and dispatch errors on the new type.","solutions":["Show the real error: `.unwrap_or_else(|e| panic!(\"ClientIdentify handler failed: {e:?}\"))` and rerun.","Add or fix the `ParsedStorageRequestV4::ClientIdentify` arm in `run_request_handler` so it records the user-agent and returns `Vec::new()` (empty ok response).","Verify the handler doesn't require session/JWT state for ClientIdentify; it should succeed with a default `AttributeMap`.","If is_trusted validation is intended, allow `is_trusted: false` clients through with a normal (non-error) response."],"exampleFix":"// before\nlet response = service\n    .run_request_handler(\n        Arc::new(AttributeMap::default()),\n        ParsedStorageRequestV4::ClientIdentify(ci),\n    )\n    .await\n    .expect(\"ClientIdentify must be handled successfully\");\n// after\nlet response = service\n    .run_request_handler(\n        Arc::new(AttributeMap::default()),\n        ParsedStorageRequestV4::ClientIdentify(ci),\n    )\n    .await\n    .unwrap_or_else(|e| panic!(\"ClientIdentify handler failed: {e:?}\"));","handlingStrategy":"try-catch","validationCode":"// Ensure the handler has a ClientIdentify arm before invoking\nassert!(\n    matches!(parsed_request, ParsedStorageRequestV4::ClientIdentify(_)),\n    \"handler test requires a parsed ClientIdentify request\"\n);","typeGuard":null,"tryCatchPattern":"let response = service\n    .run_request_handler(Arc::new(AttributeMap::default()), ParsedStorageRequestV4::ClientIdentify(ci))\n    .await\n    .unwrap_or_else(|e| panic!(\"ClientIdentify handler failed: {e:?}\"));\nassert!(response.is_empty());","preventionTips":["Add the ClientIdentify arm to run_request_handler together with the parser branch.","Keep ClientIdentify handler dependency-free (no jwt/session requirements).","Treat is_trusted=false as a normal client unless an explicit allowlist exists."],"tags":["rust","test-panic","quic","request-handler","client-identify"],"backgroundTag":"unsupported-operation","analyzedSha":"074eb0b0d1194c997d7cf28b55519e3e197b3e23","analyzedAt":"2026-09-13T09:00:57.509Z","contentChangedAt":"2026-09-13T09:00:57.509Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}