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

Strange race condition when assigning page quickly #1094

Open
1 task done
mercmobily opened this issue Mar 21, 2018 · 0 comments
Open
1 task done

Strange race condition when assigning page quickly #1094

mercmobily opened this issue Mar 21, 2018 · 0 comments

Comments

@mercmobily
Copy link
Contributor

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
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant