You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've run into a problem while using this package, and I didn't understand if it was intentional or a bug. Here is a code example from the project's documentation with modified comments explaining what I noticed.
{find(){returnNotifications.find();},children(parentNotification){// if any field from the parentNotification changes, this function WON'T rerunif(parentNotification.type==='about_post'){return[{find(notification){// if any field from the parentNotification changes, this function WILL rerunreturnPosts.find(parentNotification.objectId);}}];}return[{find(notification){// if any field from the parentNotification changes, this function WILL rerunreturnComments.find(parentNotification.objectId);}}]}}
To exemplify this behavior, imagine the user initially subscribe to the publication and we have a notification in the database with the type field as 'about_post', so consequently, the children publication will return a cursor from the Posts collection, since the first conditional will be true.
Now imagine that, with the subscription still open, we change the type field to anything (a value that isn't 'about_post'). The find() function for that notification will rerun, but the children() won't, which means that the returned child cursor will still be from the Posts collection, and won't change to return a cursor from the Comments collection.
I would be happy to provide more details or to create an example app to show this possible bug if you think it would be helpful. Thanks for your attention :)
The text was updated successfully, but these errors were encountered:
Hello!
I've run into a problem while using this package, and I didn't understand if it was intentional or a bug. Here is a code example from the project's documentation with modified comments explaining what I noticed.
To exemplify this behavior, imagine the user initially subscribe to the publication and we have a notification in the database with the
type
field as'about_post'
, so consequently, the children publication will return a cursor from thePosts
collection, since the first conditional will be true.Now imagine that, with the subscription still open, we change the
type
field to anything (a value that isn't'about_post'
). Thefind()
function for that notification will rerun, but thechildren()
won't, which means that the returned child cursor will still be from thePosts
collection, and won't change to return a cursor from theComments
collection.I would be happy to provide more details or to create an example app to show this
possiblebug if you think it would be helpful. Thanks for your attention :)The text was updated successfully, but these errors were encountered: