Repository navigation
SWF(bug): stop item delete reviving expired conversations - #10
Merged
Merged
Conversation
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
…ve-item-ttl Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> # Conflicts: # crates/spark-server/src/conversation_store.rs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Deleting an item from a TTL-expired conversation no longer revives it:
remove_itemnow evicts expired conversations likeget,update_metadataandadd_itemsalready do.Summary
ConversationStore::remove_itemlooked up the conversation with no TTL check and, on a successful removal, setlast_access = Instant::now(). SoDELETEof an item on an expired conversation succeeded and made the conversation readable again. The fix applies the store's existing expire-and-evict block (copied from the sibling methods) before touching items: an expired conversation is removed frommapandorderandremove_itemreturnsfalse.Evidence
Before (regression test added first, fix not applied):
After fix (rerun after merging main with #9):
Cases covered: expired (new
remove_item_evicts_expired_conversation: returns false, stays unreadable, evicted from map and LRU order), live (existingdelete_item_by_id), missing conversation / missing item / empty conversation (newremove_item_returns_false_when_missing).Root cause:
remove_itemwas the only accessor that mutated a conversation without the TTL gate the other accessors share, and itslast_accessrefresh is what turned an expired entry back into a live one. Gating it with the same rule removes the revival path without changing live-conversation behavior.Try it:
(
ci_gpu_stubs.shis only needed on a host without CUDA/NCCL libs, to satisfy the linker.)Test plan
cargo fmt --all -- --checkATLAS_SKIP_BUILD=1 CUDARC_CUDA_VERSION=13000 cargo clippy --workspace --tests(exit 0)bash scripts/check-license-headers.sh(4163 valid, 0 invalid)typos(clean)Notes for reviewers
Scoped to this bug only; the duplicate-item-ID-after-delete and LRU-refresh-on-writes issues in the same file are separate PRs. The not-found path still does not refresh
last_access, as before.Implemented in session Stop item delete reviving expired conversations
Review with Devin · Open in Devin Desktop