Repository navigation
Conversation
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>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ 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 🚀 New features to boost your workflow:
|
Signed-off-by: John Bair <john.bair@swirldslabs.com> Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
🟡 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)); |
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.

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.