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

Strange race condition when assigning page quickly #1094

Description

@mercmobily

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions