Skip to content

Conversation

@linuspahl
Copy link
Contributor

@linuspahl linuspahl commented Dec 12, 2025

Please note, this PR needs to be backported.

Description

Motivation and Context

As described in #22105 and #18484 there are currently multiple issues with using the browser navigation.

These issues are mostly related to the following circumstances:

  • both history.push and history.replace are being called when opening the search page
  • history.push is called twice when using the browser navigation

This PR improves when hisroty.push and history.replace are being called. Please note there is one issue #24539 left which needs to be addressed in a follow-up PR because it requires more fundamental changes.

Fixes #22105
Fixes #18484

@linuspahl linuspahl changed the title Fixing issues with using browser navigation on search page. Fix browser navigation not restoring the previous search. Dec 12, 2025

if (newView !== view) {
return dispatch(updateView(newView, true));
}
Copy link
Contributor Author

@linuspahl linuspahl Dec 12, 2025

Choose a reason for hiding this comment

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

This change is required to update the reflux store with the new view which contains the changes URL query params.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Calling updateView also executes a new search and creates a new entry in the undo / redo stack.


const newSearch = view.search.toBuilder().newId().queries([newQuery]).build();

const savedSearch = await createSearch(newSearch);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Since we are now calling updateView in bindSearchParamsFromQueryThunk we don't need to call it here anymore.

@linuspahl linuspahl marked this pull request as ready for review December 12, 2025 15:52
Copy link
Member

@dennisoelkers dennisoelkers left a comment

Choose a reason for hiding this comment

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

Looks good and works well!

@dennisoelkers dennisoelkers merged commit a8bcfe7 into master Jan 5, 2026
24 checks passed
@dennisoelkers dennisoelkers deleted the issue-22105 branch January 5, 2026 11:47
garybot2 pushed a commit that referenced this pull request Jan 5, 2026
* Properly notmalize empty query string. This fixes an error where going back to a search qithout a query string, did not update the view.

* Properly update view and execute new search when URL query oparams change. For example when using the browser navigation.

* Avoid executing search twice when using browser navigation.

* Properly update browser history when creating a new search.

* Ignore order of query params when comparing Uris.

* Rever change that caused query input to be empty on replay search page.

* Udpate tests

* Extend tests

* Improve tests

* Adding changelog

(cherry picked from commit a8bcfe7)
garybot2 pushed a commit that referenced this pull request Jan 5, 2026
* Properly notmalize empty query string. This fixes an error where going back to a search qithout a query string, did not update the view.

* Properly update view and execute new search when URL query oparams change. For example when using the browser navigation.

* Avoid executing search twice when using browser navigation.

* Properly update browser history when creating a new search.

* Ignore order of query params when comparing Uris.

* Rever change that caused query input to be empty on replay search page.

* Udpate tests

* Extend tests

* Improve tests

* Adding changelog

(cherry picked from commit a8bcfe7)
garybot2 pushed a commit that referenced this pull request Jan 5, 2026
* Properly notmalize empty query string. This fixes an error where going back to a search qithout a query string, did not update the view.

* Properly update view and execute new search when URL query oparams change. For example when using the browser navigation.

* Avoid executing search twice when using browser navigation.

* Properly update browser history when creating a new search.

* Ignore order of query params when comparing Uris.

* Rever change that caused query input to be empty on replay search page.

* Udpate tests

* Extend tests

* Improve tests

* Adding changelog

(cherry picked from commit a8bcfe7)
dennisoelkers pushed a commit that referenced this pull request Jan 6, 2026
…24636)

* Properly notmalize empty query string. This fixes an error where going back to a search qithout a query string, did not update the view.

* Properly update view and execute new search when URL query oparams change. For example when using the browser navigation.

* Avoid executing search twice when using browser navigation.

* Properly update browser history when creating a new search.

* Ignore order of query params when comparing Uris.

* Rever change that caused query input to be empty on replay search page.

* Udpate tests

* Extend tests

* Improve tests

* Adding changelog

(cherry picked from commit a8bcfe7)

Co-authored-by: Linus Pahl <[email protected]>
dennisoelkers pushed a commit that referenced this pull request Jan 6, 2026
…24637)

* Properly notmalize empty query string. This fixes an error where going back to a search qithout a query string, did not update the view.

* Properly update view and execute new search when URL query oparams change. For example when using the browser navigation.

* Avoid executing search twice when using browser navigation.

* Properly update browser history when creating a new search.

* Ignore order of query params when comparing Uris.

* Rever change that caused query input to be empty on replay search page.

* Udpate tests

* Extend tests

* Improve tests

* Adding changelog

(cherry picked from commit a8bcfe7)

Co-authored-by: Linus Pahl <[email protected]>
linuspahl added a commit that referenced this pull request Jan 6, 2026
…4638)

* Fix browser navigation not restoring the previous search. (#24538)

* Properly notmalize empty query string. This fixes an error where going back to a search qithout a query string, did not update the view.

* Properly update view and execute new search when URL query oparams change. For example when using the browser navigation.

* Avoid executing search twice when using browser navigation.

* Properly update browser history when creating a new search.

* Ignore order of query params when comparing Uris.

* Rever change that caused query input to be empty on replay search page.

* Udpate tests

* Extend tests

* Improve tests

* Adding changelog

(cherry picked from commit a8bcfe7)

* Update import path

---------

Co-authored-by: Linus Pahl <[email protected]>
Co-authored-by: Linus Pahl <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Search bar] Going back and forth in the browser history does not work. Browser Back button does not work on Search Page back to Streams Page

3 participants