Trigger onReady callback on resubscribe #8754
Conversation
This fixes #1173.
This should be ready now. |
One question - do you think we need to worry about instances where people are counting on the current (buggy) behaviour? For example, #1173 (comment). If so this might be a breaking change. |
I guess we might need a short discussion about if we want to keep the current behaviour and document that you can use However I do think this should be classified as a bug and fixed because there are more people that assume that this function would work the way it would with this PR applied. So maybe a warning in On another note, do we have any way of achieving what the developers in that comment were doing if we apply this patch? |
I would vote for merging this in and adding a history entry. |
To reflect that #8754 is a breaking change, we should bump the major version here.
Question: Why, in the case the existing subscription is not yet ready, is the ready callback overwritten instead of added? I mean the code has this comment:
But this doesn't really make sense if you think about a component-based GUI, since the onReady callback will often be used to for example hide a loading indicator. So that means if you have 2 different components subscribing to the same thing more or less at the same time, and both use the 'onReady' callback to hide a loading indicator inside the component, only one will be called and thus one component will keep showing the loading indicator? |
@sebakerckhof, even if 2 components were to subscribe to the same publication there would still be 2 separate subscription instances with their own I believe this might be more related to conditionally calling |
@zimme Yeah, nevermind, I missed the |
To reflect that #8754 is a breaking change, we should bump the major version here.
Merged into Release 1.5.1 as part of |
This fixes #1173.
Tests needs updating. I know what needs updating,
I just need to update commends and stuff before
committing.