{"record":{"id":"b4022f13ffeae991","repo":"EpicGames/lore","slug":"get-from-local-store-should-work","errorCode":null,"errorMessage":"get from local store should work","messagePattern":"get from local store should work","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"lore-server/src/quic/replication_store_service/server.rs","lineNumber":1286,"sourceCode":"            ParsedReplicationStoreRequest::Put(_)\n        ));\n\n        let handle_output = service\n            .run_request_handler(AttributeMap::default().into(), parse_output)\n            .await\n            .expect(\"handler failed\");\n        assert!(handle_output.is_empty());\n\n        // Verify the data landed in the local store\n        {\n            let local_store = local_store.clone();\n            LORE_CONTEXT\n                .scope(execution.clone(), async move {\n                    let get_output = local_store\n                        .get(repository.into(), address)\n                        .await\n                        .and_then(lore_storage::StoreGetData::into_payload)\n                        .expect(\"get from local store should work\");\n                    assert_eq!(get_output.1, payload);\n                })\n                .await;\n        }\n\n        // Verify the data is NOT in the main store\n        LORE_CONTEXT\n            .scope(execution, async move {\n                assert!(\n                    main_store\n                        .get(repository.into(), address)\n                        .await\n                        .unwrap_err()\n                        .is_address_not_found()\n                );\n            })\n            .await;\n    }","sourceCodeStart":1268,"sourceCodeEnd":1304,"githubUrl":"https://github.com/EpicGames/lore/blob/074eb0b0d1194c997d7cf28b55519e3e197b3e23/lore-server/src/quic/replication_store_service/server.rs#L1268-L1304","documentation":"A Rust test panic from `.expect(\"get from local store should work\")` in `immutable_local_put_routes_to_local_store` (lore-server/src/quic/replication_store_service/server.rs:1286). The test previously wrote data via the ImmutableLocalPut handler and now reads it back with `local_store.get(repository, address)`; the get returned an error (or `into_payload` failed), so the immutable put did not land the data where the test expects. It asserts that ImmutableLocalPut routes writes to the local store only, not the main store.","triggerScenarios":"Calling `local_store.get(repository.into(), address).await.and_then(StoreGetData::into_payload)` inside `LORE_CONTEXT.scope(execution, ...)` after a successful handler Put, and either the store returns NotFound/error or the payload conversion fails — i.e. the put wrote to a different store, a different address, or was not committed.","commonSituations":"Typical when ImmutableLocalPut routing was changed to write into the main store instead of the local one (or vice versa), when the address computed by the handler differs from the `address` the test recomputed, or when the store's async context (`LORE_CONTEXT` scope) is wrong so the local backend can't resolve its path.","solutions":["Check whether the preceding `run_request_handler` actually wrote to the local store by listing/reading the local store directly with the same (repository, address) the handler used.","Verify the handler's ImmutableLocalPut path still targets the local store and not the main store; fix the routing if it was inverted.","Confirm the `address` and `repository` values match what the handler derived from the request (hash/payload serialization differences change the address).","Print the StoreError to distinguish NotFound (wrong store/address) from an IO error (env/path problem in the test backend)."],"exampleFix":"// before\nlet get_output = local_store\n    .get(repository.into(), address)\n    .await\n    .and_then(lore_storage::StoreGetData::into_payload)\n    .expect(\"get from local store should work\");\n// after\nlet get_output = local_store\n    .get(repository.into(), address)\n    .await\n    .unwrap_or_else(|e| panic!(\"get from local store failed: {e:?}\"))\n    .into_payload()\n    .expect(\"payload conversion failed\");","handlingStrategy":"validation","validationCode":"// Confirm the write landed before asserting the readback\nlet exists = local_store\n    .get(repository.into(), address)\n    .await\n    .is_ok();\nassert!(exists, \"expected data at {:?} in local store after put\", address);","typeGuard":"fn read_payload(res: Result<lore_storage::StoreGetData, lore_storage::StoreError>) -> Option<(Vec<u8>, Bytes)> {\n    res.ok().and_then(|d| d.into_payload().ok())\n}","tryCatchPattern":"match local_store.get(repository.into(), address).await {\n    Ok(data) => match data.into_payload() {\n        Ok(p) => p,\n        Err(e) => panic!(\"payload conversion failed: {e:?}\"),\n    },\n    Err(e) => panic!(\"local store get failed: {e:?}\"),\n}","preventionTips":["Derive the test's (repository, address) from the same serialization the handler uses.","After routing changes, assert both presence in local store and absence in main store.","Include StoreError debug in all store assertions to speed diagnosis."],"tags":["rust","test-panic","storage","immutable-store","readback"],"backgroundTag":"record-not-found","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"}