Skip to content

check phase commit:#793

Merged
Baskarayelu merged 1 commit into
Remitwise-Org:mainfrom
happyboy24:test/savings-remove-tags-idempotency
Jun 19, 2026
Merged

check phase commit:#793
Baskarayelu merged 1 commit into
Remitwise-Org:mainfrom
happyboy24:test/savings-remove-tags-idempotency

Conversation

@happyboy24

Copy link
Copy Markdown
Contributor

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

@Baskarayelu

Copy link
Copy Markdown
Contributor

(title aside 🙂) the idempotent remove_tags_from_goal tests plus the tag-index consistency checks are solid. merging 👍

@Baskarayelu Baskarayelu merged commit 67788b2 into Remitwise-Org:main Jun 19, 2026
3 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Savings Goals: add remove_tags_from_goal idempotency and unknown-tag no-op tests with stale-index cleanup

2 participants