-
Notifications
You must be signed in to change notification settings - Fork 325
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(brave): not updating tab to the new redirect url in some cases. #1285
Conversation
Signed-off-by: Nishant Arora <1895906+whizzzkid@users.noreply.github.com>
Signed-off-by: Nishant Arora <1895906+whizzzkid@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Usually setTimeout
smells fishy, but sometimes this is the only way to get UX we want, especially in Brave when there is additional IPFS code in play on the browser side that executes async (like the purple button scenario).
Retrying for half a second when there are no tabs sounds like a sane failsafe: In the past, I've experienced similar ordering discrepancies between Firefox and Chromium, and they appeared and disappeared between browser releases, so this may also help with smoothing the UX there.
originUrl: 'https://ipfs.io/ipns/en.wikipedia-on-ipfs.org', | ||
redirectUrl: 'http://localhost:8080/ipns/en.wikipedia-on-ipfs.org' | ||
}) | ||
await clock.tickAsync(400) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: could we base this on MAX_RETRIES_TO_UPDATE_TAB
somehow, so the reader can figure out why we sleep here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sgtm
Signed-off-by: Nishant Arora <1895906+whizzzkid@users.noreply.github.com>
Closes: #1283
RCA:
Demo: the double refresh is slightly visible.
Purple-loop.mov