Repository navigation
fix(frontend): clear the search bar’s suggestions when the user changes - #9090
Conversation
Backport auto-label reportThis
|
Automated Reviewer SuggestionsBased on the
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #9090 +/- ##
============================================
- Coverage 91.80% 89.44% -2.37%
+ Complexity 5067 5066 -1
============================================
Files 1270 1291 +21
Lines 55186 67419 +12233
Branches 6985 9965 +2980
============================================
+ Hits 50665 60303 +9638
- Misses 2800 5194 +2394
- Partials 1721 1922 +201
*This pull request uses carry forward flags. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
…e-on-logout # Conflicts: # frontend/src/app/dashboard/component/user/search-bar/search-bar.component.spec.ts
|
Backport PR opened: draft #9228 (#9228) to |
|
Backport PR opened: draft #9229 (#9229) to |
What changes were proposed in this PR?
The top search bar caches its suggestions by the typed text and never cleared that cache. After signing out you land on the About page with the same search bar, and typing text searched before sign-out showed the previous user’s suggestions again, including private workflows, datasets and models, straight from the cache.
SearchBarComponent now clears the cache and the shown suggestions in its existing userChanged() handler, which runs on sign-in and sign-out.
Before: signed out, “sales” still suggests the private dataset sales-2026, and no request is sent:
After: signed out, “sales” goes to the public search and suggests nothing:
Any related issues, documentation, discussions?
Closes #9089
How was this PR tested?
Added a case to search-bar.component.spec.ts: after the user changes, a repeated query goes to the server as the new user instead of returning the cached suggestions. It fails without the fix.
Also checked against a local stack: signed in, typed a private dataset’s name, signed out, and typed it again. No suggestion is shown, and a public search request is sent.
Was this PR authored or co-authored using generative AI tooling?
Generated-by: Claude Code (Claude Opus 5.5)