Skip to content
This repository has been archived by the owner on Dec 11, 2019. It is now read-only.

Editing custom selection from autocomplete can clear URL suffix #9613

Merged
merged 1 commit into from
Jun 21, 2017

Conversation

bbondy
Copy link
Member

@bbondy bbondy commented Jun 20, 2017

Fix #9322

Submitter Checklist:

  • Submitted a ticket for my issue if one did not already exist.
  • Used Github auto-closing keywords in the commit message.
  • Added/updated tests for this change (for new code or code which already has tests).
  • Ran git rebase -i to squash commits (if needed).
  • Tagged reviewers and labelled the pull request as needed.

Automated test plan

npm run test -- --grep="keeps url text separate from suffix text"

Reviewer Checklist:

Tests

  • Adequate test coverage exists to prevent regressions
  • Tests should be independent and work correctly when run individually or as a suite ref
  • New files have MPL2 license header

@bbondy bbondy added this to the 0.17.x (Beta Channel) milestone Jun 20, 2017
@bbondy bbondy self-assigned this Jun 20, 2017
@bbondy bbondy requested a review from bsclifton June 20, 2017 20:51
@bsclifton
Copy link
Member

bsclifton commented Jun 21, 2017

While testing, I got this... I seem to remember we had it before (and we may have regressed):

An uncaught exception occurred in the main process Uncaught Exception:
TypeError: parsedUrl.query.split is not a function
    at SearchIndex.tokenizeInput (/Users/clifton/Documents/browser-laptop/app/common/lib/siteSuggestions.js:95:44)
    at /Users/clifton/Documents/browser-laptop/node_modules/bloodhound-js/lib/search_index.js:36:37
    at Array.forEach (<anonymous>)
    at Object.each (/Users/clifton/Documents/browser-laptop/node_modules/bloodhound-js/lib/utils.js:52:16)
    at SearchIndex.add (/Users/clifton/Documents/browser-laptop/node_modules/bloodhound-js/lib/search_index.js:32:7)
    at Bloodhound.add (/Users/clifton/Documents/browser-laptop/node_modules/bloodhound-js/lib/bloodhound.js:110:16)
    at add (/Users/clifton/Documents/browser-laptop/app/common/lib/siteSuggestions.js:113:12)
    at urlBarSuggestionsReducer (/Users/clifton/Documents/browser-laptop/app/browser/reducers/urlBarSuggestionsReducer.js:22:9)
    at reducers.reduce (/Users/clifton/Documents/browser-laptop/js/stores/appStore.js:379:24)
    at Array.reduce (<anonymous>)

IIRC, this showed up when the URL had ? or & in it (it had showed up when we switched to the fastUrl parser). I can't repro though. Something to keep an eye out for (this is logged to console, but I didn't see any impact to the UI)

Copy link
Member

@bsclifton bsclifton left a comment

Choose a reason for hiding this comment

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

LGTM! Change works good 😄 I did notice something which I believe is unrelated (see comment about TypeError: parsedUrl.query.split is not a function).

++

@bsclifton bsclifton merged commit 6ade125 into master Jun 21, 2017
@bsclifton bsclifton deleted the edit-autocomplete branch June 21, 2017 05:51
bsclifton added a commit that referenced this pull request Jun 21, 2017
Editing custom selection from autocomplete can clear URL suffix
bsclifton added a commit that referenced this pull request Jun 21, 2017
Editing custom selection from autocomplete can clear URL suffix
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Editing autocompleted URL deletes autocompleted URL with typed in key
2 participants