riot.update() not updating some tags in 2.3.1 #1353

Closed
sylvainpolletvillard opened this Issue Nov 16, 2015 · 17 comments

Projects

None yet

6 participants

@sylvainpolletvillard
Contributor

Hi,

Based on exchanges on gitter:
Ldiab :

Hi, somebody having problems with riot.update() getting an empty array in 2.3.1? In some pages I get an empty one and in others I get some of them... its really weird... Even in the Chrome Console...

me :

I got a strange issue. I use riot.update() to update a tag, it works on first call but not on the next ones. For some reason the tag disappears from riot internal tags cache. I have a similar tag at the same level that does not have this issue and is updating correctly. I tracked the bug, it is related to having a loop inside another loop in my component template. If I removed the parent loop or the child loop, riot.update() works again.

Ldiab:

Yes @sylvainpolletvillard as I said, riot.update() is behaving really weird in my webapp and it so big I can't reproduce it a quick fix is if every tag you want to update is in another tag. Then you can register in a mixin or basically outside the tag as global, and 'this.update()' where this is logically the parent tag. It works for me right now

We both have complicated setups and are unable to reproduce the issue in a plunkr, but it looks like we have some kind of regression with riot.update() in 2.3.1

I will try to find more information around this issue, and hopefully provide a reproducible test that does not require you to retrieve all of my current project. In the mean time, do you have any idea what could cause this?

Thanks

@sylvainpolletvillard
Contributor

I can confirm it is a regression. I rolled back to v2.2.4 and don't have the issue anymore.

@n1313
n1313 commented Nov 22, 2015

I have updated to 2.3.1 and indeed, some of my tags appear to not work anymore. Were there any breaking changes?

@GianlucaGuarini
Member

With no examples ( jsfiddle, plunker ) I can not help you

@sylvainpolletvillard
Contributor

I try to make one but didn't reproduce the issue yet. This is sneaky

@GianlucaGuarini
Member

I can imagine that some users did not notice that now options like <tag my-option="foo"> get converted to myOption. Maybe this can be the problem

@sylvainpolletvillard
Contributor

No, that would not explain why the tag is properly rendered but can't be updated twice.

@GianlucaGuarini
Member

I have fixed this issue that was failing silently. I would be curious to know if with the new 3.2.11 ( that I will release today ) this problem still exists

@sylvainpolletvillard
Contributor

Okay thanks, will checked it out

@sylvainpolletvillard
Contributor

Unfortunately I still have the issue with 2.3.11. I don't give up, I will try to reproduce it in a plunker starting from my current codebase.

@EyLuismi

Sorry, I has been very busy these days, but you put here all I know right now, thanks!, and right now It still getting an empty array on 2.3.11... every page in the Google Chrome Console, it gives me the empty array :S I hope to get some time in december If this is still uncaught to try to find it because I think is a "big deal", well, for perfomance It should be avoid, I can live without it but is needed at the end of the day, its a handy tool sometimes :)

@sylvainpolletvillard
Contributor

Finally, I reproduced it in a plunker 😎

http://plnkr.co/edit/4K3zpyssORSpuGgBhRhB?p=preview

Open console to see logs and click on the 2 buttons. riot.update() returns an empty array. For the second button, I guess the tag is updated because a click event occured inside.

If you remove the each={ filepath, labels in files } part inside files.tag, riot.update() works again and returns the 3 tags: app.tag, files.tag and main-menu.tag

@GianlucaGuarini
Member

@sylvainpolletvillard thanks.. it's a bug

@GianlucaGuarini GianlucaGuarini added this to the 2.4.0 milestone Nov 27, 2015
@GianlucaGuarini
Member

This issue was fixed with this patch

@GianlucaGuarini
Member

fixed in riot 2.3.15

@sylvainpolletvillard
Contributor

thank you 👍

@acousticseagull

Thank you!

@RanzQ
Contributor
RanzQ commented Feb 2, 2016

Thanks a lot, I was just about to write some hack. :)

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