fix: refresh roster data before validation to prevent stale cache #60

Merged
cal merged 2 commits from hotfix/stale-roster-cache into next-release 2026-03-02 21:07:00 +00:00
Owner

Summary

  • Hotfix: TransactionBuilder cached roster data indefinitely via _roster_loaded flag, causing /ilmove validation to report incorrect roster counts when builders persisted across multiple invocations
  • Root cause: A POR GM's /ilmove showed 7/6 MiL slots despite only having 5/6 — stale cached data from a previous builder session was being used for validation
  • Fix: validate_transaction() now always calls load_roster_data(force_refresh=True) to fetch fresh roster data before validating
  • DI improvement: Added dependency injection for roster_service in TransactionBuilder.__init__() to improve testability

Test plan

  • All 39 transaction builder tests pass
  • Full test suite passes (930 passed, 3 skipped)
  • Confirmed fix by having affected user run /clearilmove + retry (succeeded immediately)

🤖 Generated with Claude Code

## Summary - **Hotfix**: `TransactionBuilder` cached roster data indefinitely via `_roster_loaded` flag, causing `/ilmove` validation to report incorrect roster counts when builders persisted across multiple invocations - **Root cause**: A POR GM's `/ilmove` showed 7/6 MiL slots despite only having 5/6 — stale cached data from a previous builder session was being used for validation - **Fix**: `validate_transaction()` now always calls `load_roster_data(force_refresh=True)` to fetch fresh roster data before validating - **DI improvement**: Added dependency injection for `roster_service` in `TransactionBuilder.__init__()` to improve testability ## Test plan - [x] All 39 transaction builder tests pass - [x] Full test suite passes (930 passed, 3 skipped) - [x] Confirmed fix by having affected user run `/clearilmove` + retry (succeeded immediately) 🤖 Generated with [Claude Code](https://claude.com/claude-code)
cal added 1 commit 2026-03-02 20:56:36 +00:00
fix: refresh roster data before validation to prevent stale cache
All checks were successful
Build Docker Image / build (pull_request) Successful in 1m8s
9610b543ee
TransactionBuilder cached roster data indefinitely via _roster_loaded flag,
causing validation to use stale counts when builders persisted across multiple
/ilmove invocations. Now validate_transaction() always fetches fresh roster
data. Also adds dependency injection for roster_service to improve testability.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
cal added 1 commit 2026-03-02 21:04:24 +00:00
refactor: invalidate roster cache after submission instead of force-refreshing
All checks were successful
Build Docker Image / build (pull_request) Successful in 1m6s
2bb19d8dfd
Simplify review found that force_refresh=True on every validate_transaction()
call caused redundant API fetches on every embed render and button press.

Instead, invalidate the roster cache after successful submit_transaction() so
the next operation fetches fresh data. This preserves the cache for normal
interaction flows while still preventing stale data after submissions.

Also adds type annotation for roster_svc DI parameter.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
cal changed target branch from main to next-release 2026-03-02 21:05:47 +00:00
cal force-pushed hotfix/stale-roster-cache from 2bb19d8dfd to ffa0366441 2026-03-02 21:06:04 +00:00 Compare
cal merged commit bc8a256b14 into next-release 2026-03-02 21:07:00 +00:00
cal deleted branch hotfix/stale-roster-cache 2026-03-02 21:07:00 +00:00
Sign in to join this conversation.
No reviewers
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: cal/major-domo-v2#60
No description provided.