Skip to content

Prevent duplicate browser history entries on search page load - #13005

Merged
chiatt merged 3 commits into
archesproject:dev/8.2.xfrom
lalmachado:fix/search-history-duplicates-13002
Nov 5, 2026
Merged

chiatt merged 3 commits into
archesproject:dev/8.2.xfrom
lalmachado:fix/search-history-duplicates-13002

Conversation

@lalmachado

Copy link
Copy Markdown
Contributor

Fixes #13002

doQuery in base-search-view.js called history.pushState in the ajax complete callback, which also fires for aborted requests. On page load, several superseded queries each pushed an identical entry, so the back button had to be pressed multiple times.

  • Push history state in success instead of complete
  • Skip the push if the URL already matches the current location

@CLAassistant

CLAassistant commented Oct 10, 2026 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@chiatt chiatt added the Type: Bug Something isn't working label Oct 11, 2026
@lalmachado
lalmachado force-pushed the fix/search-history-duplicates-13002 branch from 803badd to 3a4fe5e Compare October 15, 2026 16:50
@chiatt
chiatt self-requested a review October 26, 2026 19:59
@chiatt chiatt self-assigned this Oct 26, 2026
@lalmachado

Copy link
Copy Markdown
Contributor Author

The build_feature_branch (3.14) failure looks unrelated to this change. It's a single error in SpatialViewTriggerTests.test_restore_state_from_serialized_graph (DuplicateTable: relation "sp_attr_spatialviews_test_532" already exists), and this PR only touches base-search-view.js. The 3.12 and 3.13 builds pass.

Could a maintainer re-run the failed 3.14 job? I don't have permission to. Thanks!

@chiatt chiatt left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This looks great @lalmachado. Could you add a changelog entry in releases/8.2.0.md under 'Bug Fixes'? It's nice to put your entry in the middle of the list to avoid conflicts.

@lalmachado

Copy link
Copy Markdown
Contributor Author

Thanks @chiatt, added the changelog entry under Bug fixes in releases/8.2.0.md (mid-list). I also rebased onto the latest dev/8.2.x.

@lalmachado
lalmachado force-pushed the fix/search-history-duplicates-13002 branch from 3a4fe5e to 9c68d6a Compare November 5, 2026 14:25
@chiatt

chiatt commented Nov 5, 2026

Copy link
Copy Markdown
Member

The failing builds do seem unrelated to these changes

@chiatt
chiatt merged commit b652016 into archesproject:dev/8.2.x Nov 5, 2026
1 of 5 checks passed
@github-project-automation github-project-automation Bot moved this to ✅ Done in pipeline Nov 5, 2026
@lalmachado
lalmachado deleted the fix/search-history-duplicates-13002 branch November 5, 2026 17:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Type: Bug Something isn't working

Projects

Status: ✅ Done

Development

Successfully merging this pull request may close these issues.

Multiple entries are added to browser history on search page load

3 participants