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

Hard to trace bug #60

Closed
dburles opened this issue Sep 15, 2015 · 4 comments
Closed

Hard to trace bug #60

dburles opened this issue Sep 15, 2015 · 4 comments

Comments

@dburles
Copy link

dburles commented Sep 15, 2015

Just thought I'd post this one as it was a weird one to trace. I was bitten by a transform on a collection that placed a couple of default fields.

The problem was brought about by having two publications that would publish the same document. The first publication returned the document with the fields option. The second publication had no restriction.

The first publication would send across the document with the limited fields plus the default fields added by the transform. Where this really bit was when subscribing to pub 2 we would receive a changed message for the existing document but it wouldn't include the fields that were added through the transform function! The solution was to remove the transform from within the publication.

Cursors returned by publications by default don't apply the transformation function, is there a specific reason why publish-composite does?

@reywood
Copy link
Collaborator

reywood commented Oct 1, 2015

Sorry for the late reply. If you could put together a minimal meteor app that exhibits this behavior, it would be extremely helpful.

@reywood
Copy link
Collaborator

reywood commented Oct 1, 2015

Upon re-reading your comments, sounds like your issue is related to #28. The reason you don't see the transform when a document is changed is explained here.

Going to close this as a duplicate of #28, but let me know if you feel this is a different issue.

@dburles
Copy link
Author

dburles commented Oct 2, 2015

Hey @reywood. My main question here is I am unsure why the transforms are being applied. Seems it would make sense to not apply any transformations in the context of the publications (as it is in a normal meteor publication).

@reywood
Copy link
Collaborator

reywood commented Oct 2, 2015

I explain why the transform is applied in this comment from #28. Meteor applies the transform when cursor.observe is used.

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

No branches or pull requests

2 participants