Repository navigation
Conversation
The cache is keyed by source index, which only means something for the profile it was filled for. Loading another profile left the old entries around. Publishing a sanitized profile also ends with viewProfile, so the cache is now cleared there too.
SourceCodeFetcher set up the communication delegate, called fetchSource and dispatched the outcome itself, which kept the logic out of reach of any other code that wants a file in the source code cache. Move it into a thunk. The component now only decides when to fetch. No behavior change.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #6410 +/- ##
==========================================
+ Coverage 84.52% 84.79% +0.27%
==========================================
Files 358 358
Lines 38837 38943 +106
Branches 11001 11023 +22
==========================================
+ Hits 32828 33023 +195
+ Misses 5574 5484 -90
- Partials 435 436 +1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
mstange
requested changes
Oct 21, 2026
Comment on lines
+95
to
+97
| if (isStale()) { | ||
| return result; | ||
| } |
Contributor
There was a problem hiding this comment.
I'd have expected the staleness checks to live in the reducer. We may still want to dispatch the actions in these cases in order to update any loading UI (hide throbbers), no?
Member
Author
There was a problem hiding this comment.
Hmm, initially I put it in the thunk to match how attemptToPublish handles uploadGeneration, but the reducer is better indeed. Moved it there. I had to change how we handle the generation as well.
A fetch that was still running when another profile got loaded wrote its result into the new source code cache, under an index that may now belong to a different file. Publishing a sanitized profile while the source view is loading is one way to get there, switching files in a zip another. Give the source code cache a generation, bumped on PROFILE_LOADED. The loading actions carry the generation from when their fetch started, and the reducer drops the ones from an older generation. That includes the LOADING states fetchSource reports after awaiting, for example when the symbol server fails and it moves on to the web. Such a LOADING entry would never be finished, and the source view doesn't fetch files that already have an entry.
canova
force-pushed
the
source-code-cache-per-profile
branch
2 times, most recently
from
October 22, 2026 14:53
6b7a006 to
5ff69bf
Compare
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.
Main | Deploy preview
This is also extracted from #6404. It's independent of #6407 and can land in either order.
The source code cache is keyed by the source code index, but there were two things that broke it:
To have one place for that check, I moved the source caching from
SourceCodeFetchertofetchSourceCodethunk action. The publish panel will also use it in #6404 to fetch the files picked for sharing.