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

Commit

Permalink
Fix intermittent fail in urlBarSuggestions loading
Browse files Browse the repository at this point in the history
Site entries were sometimes not added becuase the load event can come faster than the react component updates. I think this started happening when we improved speed around page load because things run faster now.

The provisional URL in this case isn't updated yet but the new url comes
in.

Auditors: @aekeus
  • Loading branch information
bbondy committed Jan 29, 2017
1 parent 69e61ff commit 1faf82a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
3 changes: 1 addition & 2 deletions js/components/frame.js
Original file line number Diff line number Diff line change
Expand Up @@ -830,8 +830,7 @@ class Frame extends ImmutableComponent {

const protocol = parsedUrl.protocol
const isError = this.props.aboutDetails && this.props.aboutDetails.get('errorCode')

if (!this.props.isPrivate && this.props.provisionalLocation === url && (protocol === 'http:' || protocol === 'https:') && !isError && savePage) {
if (!this.props.isPrivate && (protocol === 'http:' || protocol === 'https:') && !isError && savePage) {
// Register the site for recent history for navigation bar
appActions.addSite(siteUtil.getDetailFromFrame(this.frame))
}
Expand Down
3 changes: 2 additions & 1 deletion test/lib/brave.js
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,8 @@ var exports = {
const ret = val.value && val.value.sites && Array.from(Object.values(val.value.sites)).find(
(site) => site.location === location &&
(!waitForTitle || waitForTitle && site.title))
logVerbose('waitForSiteEntry("' + location + ', ' + waitForTitle + '") => ' + ret)
logVerbose('sites:' + JSON.stringify(val.value.sites))
logVerbose('waitForSiteEntry("' + location + '", ' + waitForTitle + ') => ' + ret)
return ret
})
})
Expand Down

1 comment on commit 1faf82a

@aekeus
Copy link
Member

@aekeus aekeus commented on 1faf82a Jan 29, 2017

Choose a reason for hiding this comment

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

++

Please sign in to comment.