📋 Description
SavingsGoalContract::remove_tags_from_goal in savings_goals/src/lib.rs is the inverse of add_tags_to_goal and must keep the goal's tag set and any goal-by-tag index consistent. The add path and tag-charset canonicalization are tested, but removal has gaps: removing a tag that isn't present, removing the same tag twice, and removing the last tag should all be well-defined no-ops or clean deletions.
Why this matters: tag indexes feed off-chain search and the goals-by-tag lookup. A removal path that leaves a dangling index entry (or errors on an absent tag) produces ghost search results and confuses clients. Idempotent, index-clean removal is the contract clients depend on.
🎯 Requirements & Context
Functional requirements
Context & constraints
- Soroban SDK
=21.7.7, edition 2021. Reuse the shared canonicalize_tags helper from remitwise-common/src/lib.rs.
- Test-only; do not change behavior unless a dangling-index bug is found, in which case document it.
🛠️ Suggested Execution
1. Fork & branch
git checkout -b test/savings-remove-tags-idempotency
2. Implement changes
- Add the removal tests to
savings_goals/src/test.rs with /// comments per scenario.
- Document the idempotent-removal contract in
docs/.
3. Test & commit
cargo test -p savings_goals remove_tags -- --nocapture
- Edge cases: mixed-case tags that canonicalize to the same value, removing tags from an archived goal, and removing a tag whose index has already been cleaned.
Example commit message
test(savings): cover remove_tags_from_goal idempotency and stale-index cleanup
Adds no-op, double-remove, last-tag, and index-cleanup assertions plus
owner-auth checks.
✅ Acceptance Criteria & Guidelines
| Requirement |
Target |
Coverage of remove_tags_from_goal |
≥ 95% |
| Idempotency + index-cleanup asserted |
Required |
| Owner-auth negative test |
Required |
Doc comments + docs/ note |
Required |
cargo test -p savings_goals + cargo clippy clean |
Required |
| Timeframe |
96 hours from assignment |
💬 Community & Support
Join the Remitwise contributor community on Discord: https://discord.gg/CtQuPZFMA
Comment when you pick this up. 🚀
📋 Description
SavingsGoalContract::remove_tags_from_goalinsavings_goals/src/lib.rsis the inverse ofadd_tags_to_goaland must keep the goal's tag set and any goal-by-tag index consistent. The add path and tag-charset canonicalization are tested, but removal has gaps: removing a tag that isn't present, removing the same tag twice, and removing the last tag should all be well-defined no-ops or clean deletions.🎯 Requirements & Context
Functional requirements
Unauthorizedfor non-owner) and that canonicalization matchesadd_tags_to_goal.Context & constraints
=21.7.7, edition 2021. Reuse the sharedcanonicalize_tagshelper fromremitwise-common/src/lib.rs.🛠️ Suggested Execution
1. Fork & branch
2. Implement changes
savings_goals/src/test.rswith///comments per scenario.docs/.3. Test & commit
cargo test -p savings_goals remove_tags -- --nocaptureExample commit message
✅ Acceptance Criteria & Guidelines
remove_tags_from_goaldocs/notecargo test -p savings_goals+cargo clippyclean💬 Community & Support
Join the Remitwise contributor community on Discord: https://discord.gg/CtQuPZFMA
Comment when you pick this up. 🚀