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

Unset fields are not unset #153

Open
derwaldgeist opened this issue Mar 11, 2023 · 3 comments
Open

Unset fields are not unset #153

derwaldgeist opened this issue Mar 11, 2023 · 3 comments
Labels

Comments

@derwaldgeist
Copy link

derwaldgeist commented Mar 11, 2023

Assume we have a document that looks like this:

{
    _id: '4711',
    food: {
        fruit: ['apple']
    }
}

I now unset property fruit completely, so the document looks like this:

{
    _id: '4711',
    food: {
    }
}

However, publishComposite will still report the unset property to the client, so it still looks like this:

{
    _id: '4711',
    food: {
        fruit: ['apple']
    }
}

This is also how the document looks if it is passed to any children.

Hence, the database and publishComposite get out of sync in the case a field is being unset.

Interestingly, if I reload the browser tab so the subscription is run for the first time again, the content updates (i.e. the field is unset).

I've not experienced this behaviour with regular Meteor subscriptions, so I guess this is due to some caching inside publishComposite.

@github-actions
Copy link

Thank you for submitting this issue!

We, the Members of Meteor Community Packages take every issue seriously.
Our goal is to provide long-term lifecycles for packages and keep up
with the newest changes in Meteor and the overall NodeJs/JavaScript ecosystem.

However, we contribute to these packages mostly in our free time.
Therefore, we can't guarantee your issues to be solved within certain time.

If you think this issue is trivial to solve, don't hesitate to submit
a pull request, too! We will accompany you in the process with reviews and hints
on how to get development set up.

Please also consider sponsoring the maintainers of the package.
If you don't know who is currently maintaining this package, just leave a comment
and we'll let you know

@StorytellerCZ
Copy link
Member

Could this be part of #146 ?

@alisnic
Copy link
Contributor

alisnic commented Feb 2, 2024

@derwaldgeist what publication strategy are you using? publish-compose relies on SessionCollectionView internals in order to deduce what fields need to be unset. If you are using anything else than SERVER_MERGE, unsetting won't work properly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants