Skip to content

fix(frontend): clear the search bar’s suggestions when the user changes - #9090

Merged
mengw15 merged 3 commits into
apache:mainfrom
tanishqgandhi1908:fix/search-bar-cache-on-logout
Oct 30, 2026
Merged

mengw15 merged 3 commits into
apache:mainfrom
tanishqgandhi1908:fix/search-bar-cache-on-logout

Conversation

@tanishqgandhi1908

Copy link
Copy Markdown
Contributor

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:

before-2-logged-out-still-suggested

After: signed out, “sales” goes to the public search and suggests nothing:

after-1-logged-out-no-suggestion

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.

cd frontend
yarn ng test --watch=false --include='**/search-bar.component.spec.ts'
# Tests  10 passed (10)

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)

@Yicong-Huang Yicong-Huang added release/v1.3 back porting to release/v1.3 release/v1.2 back porting to release/v1.2 labels Oct 22, 2026
@github-actions
github-actions Bot requested review from mengw15 and xuang7 October 22, 2026 01:42
@github-actions

Copy link
Copy Markdown
Contributor

Backport auto-label report

This fix: PR was checked against each actively-supported release branch. A release/* label nominates a backport target; the branch's release manager approving this PR is what sends the fix there. The required Backport Approvals check stays red until every label below is approved, so each manager either approves or removes their own label — which is why the labels left on a merged PR are exactly the branches it reached.

Release branch Analysis
✅ release/v1.3 Change detected on this branch — label added; this fix is queued to backport here. @mengw15 decides: approving sends the fix here, removing this label declines it. The merge waits on one or the other. Review requested.
✅ release/v1.2 Change detected on this branch — label added; this fix is queued to backport here. @xuang7 decides: approving sends the fix here, removing this label declines it. The merge waits on one or the other. Review requested.

Auto-label run.

@github-actions github-actions Bot added fix frontend Changes related to the frontend GUI labels Oct 22, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Automated Reviewer Suggestions

Based on the git blame history of the changed files, we recommend the following reviewers:

  • Contributors with relevant context: @aglinxinyuan
    You can notify them by mentioning @aglinxinyuan in a comment.

@codecov-commenter

codecov-commenter commented Oct 22, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.44%. Comparing base (00395b8) to head (f6dace9).

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     
Flag Coverage Δ *Carryforward flag
access-control-service 77.44% <ø> (ø) Carriedforward from 3b8e43e
agent-service 99.16% <ø> (ø) Carriedforward from 3b8e43e
amber 85.96% <ø> (-0.01%) ⬇️ Carriedforward from 3b8e43e
computing-unit-managing-service 61.84% <ø> (ø) Carriedforward from 3b8e43e
config-service 87.50% <ø> (ø) Carriedforward from 3b8e43e
file-service 81.92% <ø> (ø) Carriedforward from 3b8e43e
frontend 90.58% <100.00%> (-5.91%) ⬇️
notebook-migration-service 83.77% <ø> (ø) Carriedforward from 3b8e43e
pyamber 98.54% <ø> (ø) Carriedforward from 3b8e43e
workflow-compiling-service 72.61% <ø> (ø) Carriedforward from 3b8e43e

*This pull request uses carry forward flags. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

…e-on-logout

# Conflicts:
#	frontend/src/app/dashboard/component/user/search-bar/search-bar.component.spec.ts

@xuang7 xuang7 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@mengw15
mengw15 added this pull request to the merge queue Oct 30, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Oct 30, 2026
@mengw15
mengw15 added this pull request to the merge queue Oct 30, 2026
Merged via the queue into apache:main with commit 553ab15 Oct 30, 2026
26 of 28 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

Backport PR opened: draft #9228 (#9228) to release/v1.2, assigned to @tanishqgandhi1908 — needs manual work because the cherry-pick conflicts.

@github-actions

Copy link
Copy Markdown
Contributor

Backport PR opened: draft #9229 (#9229) to release/v1.3, assigned to @tanishqgandhi1908 — needs manual work because the cherry-pick conflicts.

mengw15 added a commit that referenced this pull request Oct 30, 2026
…the #9090 test)

#9090 added its test right before three tests from #8701, which is not on
release/v1.3, so the cherry-pick conflicted. Keep only the #9090 test; the
#8701 tests use helpers this branch does not have.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fix frontend Changes related to the frontend GUI release/v1.2 back porting to release/v1.2 release/v1.3 back porting to release/v1.3

Projects

None yet

Development

Successfully merging this pull request may close these issues.

The search bar suggests the previous user’s private resources after signing out

5 participants