Skip to content

Fix issue on meteor 3.0 on patch publish and perserve env variable#191

Merged
zendranm merged 1 commit into
Meteor-Community-Packages:masterfrom
nachocodoner:fix-publish-wrapper
Sep 13, 2024
Merged

Fix issue on meteor 3.0 on patch publish and perserve env variable#191
zendranm merged 1 commit into
Meteor-Community-Packages:masterfrom
nachocodoner:fix-publish-wrapper

Conversation

@nachocodoner
Copy link
Copy Markdown
Member

This PR refers to the issue #190 and refered to the core at meteor/meteor#13258.

The fix involves using EnvironmentVariable.withValue before calling publish.call. This ensures the context is preserved and spread properly throughout the entire flow of an altered publication. This was a breaking change on Meteor 3 added on this change, meteor/meteor#13063.

I tried running the test suite to check if anything else is broken that might need deeper investigation on the meteor core level or if this fix is sufficient for all publication alterations as the one on this repository. I also wanted to add a regression test, but the suite isn't passing any tests. What am I doing wrong?

@zendranm
Copy link
Copy Markdown
Collaborator

zendranm commented Sep 4, 2024

Hi @nachocodoner Thank you for creating this PR. Regarding tests, we recently had problems with running tests both on the CI and locally. We are currently working on fixing it.

As for the PR, I've tested this manually and it seems to solve the issue just fine.

@zendranm zendranm merged commit 39c9ad0 into Meteor-Community-Packages:master Sep 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Meteor 3: Error: Meteor.userId (DDP._CurrentPublicationInvocation.get()) patchPublish problem

2 participants