check phase commit:#793
Merged
Baskarayelu merged 1 commit intoJun 19, 2026
Merged
Conversation
Contributor
|
(title aside 🙂) the idempotent remove_tags_from_goal tests plus the tag-index consistency checks are solid. merging 👍 |
5 tasks
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.
Test idempotent remove_tags_from_goal behavior + tag-index cleanup invariants
Summary
Adds regression tests to ensure remove_tags_from_goal is idempotent and keeps the (owner, tag) tag index consistent—especially after repeated removals and when removing the last remaining tag.
What changed
savings_goals/src/test.rs
test_remove_tags_absent_tag_is_noop_and_does_not_touch_index
test_remove_tags_same_tag_twice_is_idempotent_and_index_clean
test_remove_last_tag_leaves_empty_tags_and_cleans_index
Included test_remove_tags_from_goal_non_owner_auth_panics for authorization coverage
Expected behavior covered
Canonicalization consistency between add and remove paths (mixed-case inputs)
Removing absent tags is a no-op and does not create ghost index entries
Removing the same tag multiple times does not reintroduce it into storage or the tag index
Removing the last tag leaves goal.tags empty and ensures get_goals_by_tag returns no results
Owner-only authorization is enforced for removals
Testing note
Attempted to run targeted cargo test -p savings_goals ... commands, but the environment failed during rustup component installation (filesystem conflicts such as “Directory not empty” / detected conflicts). The test additions themselves are committed to the repo.
closes #758