Repository navigation
fix(files): classify newly scanned cache entries correctly - #66526
Open
joshtrichards wants to merge 4 commits into
Open
joshtrichards wants to merge 4 commits into
joshtrichards wants to merge 4 commits into
Conversation
The scanner uses -1 as the sentinel for entries without an existing cache ID. Because -1 is truthy in PHP, the current check dispatches FileCacheUpdated instead of NodeAddedToCache for new entries. Compare the ID explicitly against -1 so new and updated entries dispatch the appropriate events and are counted correctly. Signed-off-by: Josh <josh.t.richards@gmail.com>
Verify that scanning dispatches NodeAddedToCache for a new entry and FileCacheUpdated for an existing changed entry. Assisted-by: Copilot:gpt-6.1-terra Signed-off-by: Josh <josh.t.richards@gmail.com>
Define FILE_ID_NOT_IN_CACHE and use it for the default, assignment, and insert/update checks in the cache scanner. Signed-off-by: Josh <josh.t.richards@gmail.com>
Use Scanner::FILE_ID_NOT_IN_CACHE instead of the -1 literal when distinguishing new cache entries from existing ones. Also swap the conditional logic ordering for clarity. Signed-off-by: Josh <josh.t.richards@gmail.com>
come-nc
approved these changes
Nov 12, 2026
This branch has not been deployed
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.
Summary
Scanner::FILE_ID_NOT_IN_CACHEso new entries dispatchNodeAddedToCacheinstead ofFileCacheUpdated.-1sentinel with the named constantScanner::FILE_ID_NOT_IN_CACHE.Noticed while looking at the difference between
CacheEntryInsertedEventandNodeAddedToCacheevents.Context:
-1when there is no existing file ID, andaddToCache()uses that value to distinguish inserts from updates. This change names the existing sentinel; its value and behavior are unchanged.TODO
Checklist
3. to review, feature component)stable32)AI (if applicable)