Skip to content

fix: always invalidate cached transactions on status events - #3793

Open
jbair06 wants to merge 2 commits into
mainfrom
3733-fix-stale-transaction-status-cache
Open

jbair06 wants to merge 2 commits into
mainfrom
3733-fix-stale-transaction-status-cache

Conversation

@jbair06

@jbair06 jbair06 commented Nov 20, 2026 •

Copy link
Copy Markdown
Member

Fixes #3733

Status-update events no longer skip cache entries younger than 1s, and the backend transaction cache TTL is now 10s so a missed event can only leave stale data briefly. See the issue for details.

Drop the 1s age guard in EntityCache.forget and shorten the backend transaction cache TTL to 10s.

Signed-off-by: John Bair <john.bair@swirldslabs.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@jbair06
jbair06 requested a review from a team as a code owner November 20, 2026 22:57
@codecov

codecov Bot commented Nov 20, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.98%. Comparing base (424ed25) to head (61c56de).

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #3793   +/-   ##
=======================================
  Coverage   99.98%   99.98%           
=======================================
  Files         224      224           
  Lines        7034     7034           
  Branches     1302     1276   -26     
=======================================
  Hits         7033     7033           
  Misses          1        1           

Impacted file tree graph

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@jbair06 jbair06 self-assigned this Nov 20, 2026
@jbair06 jbair06 added Bug A error that causes the feature to behave differently than what was expected based on design docs Frontend Frontend development work labels Nov 20, 2026
@jbair06 jbair06 added this to the v0.43.0 milestone Nov 20, 2026
Signed-off-by: John Bair <john.bair@swirldslabs.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The change leaves SDK transaction-ID aliases cached, so status events can still return stale transaction data through alternate lookup paths.

2 open issues
What changed in this PR

This pull request prevents stale backend transaction data after status events by making cache invalidation unconditional and shortening the backend transaction cache lifetime.

Changes:

  • Removes age-based cache invalidation checks.
  • Updates transaction-related event handlers to invalidate entries immediately.
  • Adds a 10-second backend transaction cache TTL and regression coverage for invalidation, concurrency, and expiration.
File Description
front-end/​src/​tests/​renderer/​pages/​TransactionDetails/​TransactionDetails.spec.ts Tests status-event cache invalidation and transaction refetch behavior.
front-end/​src/​tests/​renderer/​caches/​backend/​BackendTransactionCache.spec.ts Tests backend cache invalidation, concurrent lookups, and TTL expiration.
front-end/​src/​renderer/​pages/​Transactions/​components/​TransactionNodeTable.vue Uses unconditional transaction cache invalidation after notification updates.
front-end/​src/​renderer/​pages/​Transactions/​components/​History.vue Uses unconditional transaction cache invalidation before refreshing history.
front-end/​src/​renderer/​pages/​TransactionGroupDetails/​TransactionGroupDetails.vue Invalidates group transaction cache entries immediately after updates.
front-end/​src/​renderer/​pages/​TransactionDetails/​TransactionDetails.vue Invalidates the displayed transaction before notification-triggered refetches.
front-end/​src/​renderer/​caches/​base/​EntityCache.ts Removes the age restriction from cache entry eviction.
front-end/​src/​renderer/​caches/​backend/​BackendTransactionCache.ts Applies a 10-second lifetime to backend transaction cache entries.
front-end/​src/​renderer/​App.vue Invalidates transaction cache entries for websocket transaction events.

Review effort: Lite

for (const transactionId of parsed.transactionIds) {
// We clear cache with strict==false to keep young data
appCache.backendTransaction.forget(transactionId, serverUrl, false);
appCache.backendTransaction.forget(transactionId, serverUrl);
Comment on lines +33 to +34
public forget(key: K, mirrorNodeUrl: string): void {
this.records.delete(this.makeRecordKey(key, mirrorNodeUrl));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug A error that causes the feature to behave differently than what was expected based on design docs Frontend Frontend development work

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Transaction details page can show stale status (cached backend lookup ignores status-update event)

2 participants