Skip to content

beforeEnter is called multiple times with @PreserveOnRefresh #12356

Closed

Description

@haijian-vaadin

Description of the bug / feature

Having @PreserveOnRefresh on the root layout, the child view/layout's beforeEnter() callback is called multiple (level of nesting) times when refreshing the page

Minimal reproducible example

See the attached project.

  1. Go to localhost:8080, see that the beforeEnter() is called only once for each view/layout
  2. Refresh the page, see the count of beforeEnter() call for each view/layout is increased by the number of its nesting level.

Expected behavior

the child view/layout's beforeEnter() callback is called only once when refreshing the page

Actual behavior.

the child view/layout's beforeEnter() callback is called multiple (level of nesting) times when refreshing the page.

Versions:

- Vaadin / Flow version: Vaadin 14, Vaadin 22
- Java version: OpenJDK Runtime Environment Corretto-16.0.1.9.1 (build 16.0.1+9)
- OS version: macOS Monterey 
- Browser version (if applicable): 95.0.4638.69 (Official Build) (x86_64)
- Application Server (if applicable): 9.4.36.v20210114
- IDE (if applicable): VS Code

skeleton-starter-flow.zip

Activity

  1. self-assigned this
    on Nov 24, 2021
  2. added a commit that references this issue on Nov 30, 2021
    18f8db9
  3. added 8 commits that reference this issue on Nov 30, 2021
    6783c72
    9617f68
    c30e14f
    966c3f9
    d9c2984
    0dc6bdb
    3f3b786
    8a1ce73
  4. vaadin-bot commented on Dec 7, 2021

    @vaadin-bot
    Collaborator

    This ticket/PR has been released with platform 14.8.0.beta1 and is also targeting the upcoming stable 14.8.0 version.

  5. vaadin-bot commented on Dec 7, 2021

    @vaadin-bot
    Collaborator

    This ticket/PR has been released with platform 14.7.8.

  6. vaadin-bot commented on Dec 9, 2021

    @vaadin-bot
    Collaborator

    This ticket/PR has been released with platform 22.0.1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions