(sidebar): key remote project hiding by alias, not path alone - #237
Merged
Conversation
remove-project derived the cache/search folder key from projectPath alone, missing the alias::path prefix a remote group's key actually carries, so hiding a remote project left its rows and search entries behind. Hidden-project identity was also path-only while groups are keyed by alias+path, so hiding a remote /x also hid a local /x. remove-project now takes the group's folder key, cleans the right cache entry, and writes an alias-qualified hidden entry for remote groups; the three group filters in session-cache.js now match either form through one helper.
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.
Hiding a project that lives on a remote SSH host had two defects. Neither
changes the behaviour of hiding a local project.
The cleanup deleted the wrong folder
The handler derived the cache key from the path alone:
For a remote group that yields
-tmp-xwhere the real key isplanificator::-tmp-x. Nothing matched, silently: the hidden project kept itsrows in
session_cacheand its entries in the search index, so its sessionsstill came back in search results after being hidden.
The renderer now passes the group's folder key, which is used verbatim when
present. Without it the previous behaviour stands, so every other caller is
unaffected.
The hidden identity did not match the group identity
Sidebar groups are keyed on alias + projectPath — two hosts can hold the same
absolute path, and so can this machine. The hidden list held bare paths, so
hiding a remote
/srv/xalso hid a local/srv/x.A hidden entry is now either a bare path, which keeps its legacy meaning of
hiding that path everywhere, or
<alias>::<projectPath>, which hides it onthat host only. Existing entries are left as they are — they keep working.
One helper,
isProjectHidden, carries the test for all three filter sites.Verification
Mutation-pinned in both directions:
session-cache.jsalone turns red exactly the two tests assertingthat a host-qualified hide leaves the identically-named local group alone.
The legacy bare-path test stays green, which is the point: that behaviour is
unchanged.
key's path from the sidebar to the handler.
task check: 1153 passed, 0 failed, 8 pre-existing skips, lint 0 errors.