Skip to content

Suspended component still trigger watchers while being switched out #6811

Open
@posva

Description

@posva

Vue version

latest

Link to minimal reproduction

https://sfc.vuejs.org/#eNq1VMGOmzAQ/ZWRL2QlAneUbLt/UHWvXFgYwKmxLduQVhH/3sF2GtioaaXVKorAM2+ex2+eubAXrbNpRFawg60N1w4sulE/lxKAD1oZBxewfSWEOn/HNgVt1MQbhBlaowZIqDhZgb9VBqV7/SXrmM/yW2jZ6R78Yu/RPhbh9HO1ktaBUaNDOK762d3InxZc7G6XeGiShhJKASz/dpS140qCU10ncPcElyUMAZZNlRgX/s3qeFwf6sum6WKVWojmUh7yoCMpSAuHgxaVQ6/n4W10jjb/Wgte/ziWLHRRMp+F2JRH5gHqSWjZmwg5vI5Wo7SB0EdqRWJKagIKbonUN18yyK8l+armkP/piKUsjGE/VDo7WSXJBF6OMiZsyYqrQCWjYSzrkvXOaVvkuW39hE42U6bL6S0zo3R8wAztsH8z6mzREHHJ0hVHTsEJzZ5ka9CgecT5DnrHGyWf6Shbkz2087lydZ8Clyes3dbGwWhKYCZUt0sCKfjBC1U1XHaJ99LWjoHp6jkP8HvsyF/H57WbUgihKOpms7qvZIehncVcgWhOr2A+DNhwmlwBzhBViLZitH0BiVbW+as1U9kjDzZ8isZYnS54LqS2Fnl3HW/C/q+k4eLhTw9ssK1GQQXRvZW/RX5Et7sYhflMff2+HxA4dGmobyPhQhZclv7xjy/Anfpe2b/JP/8GNyvngQ==

Steps to reproduce

  • click the button

What is expected?

only one watcher should trigger

What is actually happening?

both, the watcher of the leaving and entering component are benig triggered

System Info

No response

Any additional comments?

In this scenario the update of the variable being watched is what triggers the switch

Is this just a race condition? Since the old component still needs to display, I would say it's normal for it to render due to watchers. This would require vue router to have a special handling of the current route so

Metadata

Metadata

Assignees

No one assigned

    Labels

    🐞 bugSomething isn't workingneed guidanceThe approach/solution in the PR is unclear and requires guidance from maintainer to proceed further.scope: suspense

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions