Strange race condition when assigning page quickly
mercmobily opened this issue · 0 comments
Description
When using the straight PSK, if you assign in quick sequence this.page
, the ultimately selected page doesn't get style applied (custom-styles)
I REALISE that this is a very edge case. You might wonder "why would you ever do that?".
My code actually checks if the person is logged in, and it decides if the user should be shown the login page or not. WIth two different variables in _routePageChanged()
, Polymer ends up calling _routePageChanged()
twice in a row.
Also, this could be the symptom for a race condition. I couldn't figure out why it's happening.
Expected outcome
I would expect the styles to be applied regardless
Actual outcome
The page is not rendered properly
Steps to reproduce
- mkdir testing; cd testing
polymer init
- vim src/my-app.html
Add this.page = 'view3';
to _routePageChanged()
so that it looks like this:
_routePageChanged(page) {
this.page = 'view3';
this.page = page || 'view1';
Reload deleting cache. There will be no circle.
Browsers Affected
- Chrome
- [?] Edge
- [?] Firefox
- [?] IE 11
- [?] Safari 8
- [?] Safari 9