{"record":{"id":"7002cb420bb64338","repo":"nautechsystems/nautilus_trader","slug":"unsupported-operation-update-for-collection-c","errorCode":null,"errorMessage":"Unsupported operation: `update` for collection '{collection}'","messagePattern":"Unsupported operation: `update` for collection '(.+?)'","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/infrastructure/src/redis/cache.rs","lineNumber":1046,"sourceCode":"\n    match collection {\n        ACCOUNTS | ORDERS | POSITIONS => {\n            replace_list(pipe, key, value[0].as_ref());\n            Ok(())\n        }\n        _ => anyhow::bail!(\"Unsupported operation: `replace_list` for collection '{collection}'\"),\n    }\n}\n\nfn update(pipe: &mut Pipeline, collection: &str, key: &str, value: &[Bytes]) -> anyhow::Result<()> {\n    check_slice_not_empty(value, stringify!(value))?;\n\n    match collection {\n        ACCOUNTS | ORDERS | POSITIONS => {\n            update_list(pipe, key, value[0].as_ref());\n            Ok(())\n        }\n        _ => anyhow::bail!(\"Unsupported operation: `update` for collection '{collection}'\"),\n    }\n}\n\nfn update_list(pipe: &mut Pipeline, key: &str, value: &[u8]) {\n    pipe.rpush_exists(key, value);\n}\n\nfn delete(\n    pipe: &mut Pipeline,\n    collection: &str,\n    key: &str,\n    value: Option<Vec<Bytes>>,\n) -> anyhow::Result<()> {\n    log::debug!(\n        \"delete: collection={}, key={}, has_payload={}\",\n        collection,\n        key,\n        value.is_some()","sourceCodeStart":1028,"sourceCodeEnd":1064,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/infrastructure/src/redis/cache.rs#L1028-L1064","documentation":"update only supports the update (RPUSH-to-existing-list) operation for ACCOUNTS, ORDERS, and POSITIONS collections. Other collections fall through to the wildcard arm and bail. The function guards Redis list appends so they cannot corrupt collections stored as strings, sets, or hashes.","triggerScenarios":"Calling update (e.g. from py_update in the Python bindings) with a collection other than ACCOUNTS/ORDERS/POSITIONS, such as passing an index key, ACTORS, STRATEGIES, or a misspelled collection name.","commonSituations":"Python-side cache code calling cache.update() with a collection name that is actually handled by another operation; strategies customizing serialization for a collection the adapter does not stream as a list; typos in collection constants.","solutions":["Verify the collection argument is exactly ACCOUNTS, ORDERS, or POSITIONS before calling update.","Route other collections through their supported operations (set/delete/index APIs).","Add a new match arm in update if list-append semantics are required for another collection.","Check Python call sites (py_update) for swapped or wrong collection arguments."],"exampleFix":"// before\nupdate(pipe, \"ACTORS\", key, value)?; // not list-appended\n// after\nupdate(pipe, ORDERS, key, value)?;","handlingStrategy":"try-catch","validationCode":"const UPDATABLE: [&str; 3] = [ACCOUNTS, ORDERS, POSITIONS];\nassert!(UPDATABLE.contains(&collection), \"update not supported for {collection}\");","typeGuard":null,"tryCatchPattern":"// Python\ntry:\n    cache.update(collection, key, value)\nexcept RuntimeError as e:\n    if \"Unsupported operation: `update`\" in str(e):\n        log.error(\"Cannot append-update collection %s via Redis adapter\", collection)\n    else:\n        raise","preventionTips":["Only call update for state streamed as Redis lists (accounts/orders/positions).","Review py_update call sites after adding new collections.","Add integration tests that iterate all collections your system writes."],"tags":["redis","cache","unsupported-operation","collection"],"backgroundTag":"unsupported-operation","analyzedSha":"18893faf8b356be3320add8de2f861b0b647cf06","analyzedAt":"2026-09-08T20:49:34.690Z","contentChangedAt":"2026-09-08T20:49:34.690Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}