Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unpredictable async components behaviour #7107

Closed
shine-on opened this issue Nov 22, 2017 · 1 comment
Closed

Unpredictable async components behaviour #7107

shine-on opened this issue Nov 22, 2017 · 1 comment

Comments

@shine-on
Copy link

shine-on commented Nov 22, 2017

Version

2.5.8

Reproduction link

https://codepen.io/anon/pen/VrXxGY

Steps to reproduce

Please run codepen provided.

Check out console for output: listener3, listener2, listener1 got resolved and talker got notifed back on their resolution

  • listener3 uses setTimeout callback resolver
  • listener2 uses $bus.$on callback resolver
  • listener1 uses $bus.$on callback resolver wrapped by a Promise

Case 1. Among listeners, have only listener2 (comment out listener3 and listener1)

Case 2. Among listeners, have listener3 and listener2 (comment out listener1)

What is expected?

Case 1. Talker should be notified back on listener2 resolution

Case 2. Talker should be notified back on listener2 resolution independently from (asynchronously to) listener3 resolution.

What is actually happening?

Case 1. Talker has never notified back on listener2 resolution

Case 2. Talker has notified back on listener2 resolution simultaneously (synchronously) to listener3 resolution (i.e. listener2 resolution is delayed until listener 3 timed out)


"Normal" combinations are:

  • listener1 and listener3: listener1 resolves asynchronously to listener3
  • listener1 and listener2: both resolves (which is kinda surprising since listener2 alone never resolves, see Case 1 above)
  • listener3, listener2 and listener1
@shine-on
Copy link
Author

There's a typo on
https://github.com/vuejs/vue/blob/dev/src/core/instance/lifecycle.js#L196

"wathcer's" should be "watcher's"

Thank you for a fix.

lovelope pushed a commit to lovelope/vue that referenced this issue Feb 1, 2018
f2009 pushed a commit to f2009/vue that referenced this issue Jan 25, 2019
aJean pushed a commit to aJean/vue that referenced this issue Aug 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant