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

Unmount event triggered without mount event #2409

Closed
pmmf85 opened this Issue Jul 26, 2017 · 2 comments

Comments

Projects
None yet
2 participants
@pmmf85

pmmf85 commented Jul 26, 2017

1. Describe your issue:
I know that example is a little bit crazy, but it happened in my app. Basically I trigger update method in on('mount') event handler, both for parent and child tag. Some strange event flow is invoked and first child tag created inside parent tag emits only these events:

  • before-mount
  • before-unmount
  • unmount

In unmount event handler printing this.isMounted returns true while no mount event was triggered.
In my app, I was also able to generate flow like that: before-mount -> update -> updated -> before-unmount -> unmount (for this case no working example yet).

My problem is that I create some custom object in 'mount' event, then destroy it in 'unmount' and as you may guess I get errors, as I want to call destroy something that wasn't created.

Question: Is it ok that 'unmount' event is triggered despite the fact that no 'mount' event was triggered before?

2. Can you reproduce the issue?
http://plnkr.co/edit/bKmdXvmfj8te1d7QVY0x?p=preview

3. On which browser/OS does the issue appear?
Chrome 59.0.3071.115, macOS, Sierra

4. Which version of Riot does it affect?
Riot 3.6.1

5. How would you tag this issue?

  • Question
  • Bug
  • Discussion
  • Feature request
  • Tip
  • Enhancement
  • Performance

@GianlucaGuarini GianlucaGuarini added the bug label Jul 30, 2017

@GianlucaGuarini

This comment has been minimized.

Show comment
Hide comment
@GianlucaGuarini

GianlucaGuarini Jul 30, 2017

Member

@pmmf85 thanks you have found a bug and what's confusing is that tags in loops dispatch update and updated events despite they were just mounted see this.

I will check it soon

Member

GianlucaGuarini commented Jul 30, 2017

@pmmf85 thanks you have found a bug and what's confusing is that tags in loops dispatch update and updated events despite they were just mounted see this.

I will check it soon

@GianlucaGuarini

This comment has been minimized.

Show comment
Hide comment
@GianlucaGuarini

GianlucaGuarini Aug 22, 2017

Member

this issue was not properly fixed

Member

GianlucaGuarini commented Aug 22, 2017

this issue was not properly fixed

@GianlucaGuarini GianlucaGuarini removed the fixed label Aug 22, 2017

GianlucaGuarini added a commit that referenced this issue Aug 22, 2017

GianlucaGuarini added a commit that referenced this issue Aug 22, 2017

GianlucaGuarini added a commit that referenced this issue Aug 23, 2017

Merge branch 'bug/2409' into dev
* bug/2409:
  fixed: #2409 and added tests for #2428 and #2409
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment