-
Notifications
You must be signed in to change notification settings - Fork 80
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
Wrong merging of documents #161
Comments
Fast Render IssueHere's the client-side merge box like functionality I used - https://github.com/kadirahq/fast-render/blob/master/lib/client/fast_render.js#L41 FlowRouter SSR issueI think yes. That's right. We need to do shallow copy |
Yes, but why client-side? This means that the injected data can be unnecessary huge! You could have same documents multiple times send to the client.
Yes, I think we could do that. We would just create a our own session object and then reuse the rest of Meteor codebase.
You could just use |
I could look into using sessions, but then the API will change to one returning documents themselves for the whole session (which would be one per one HTTP request made). But integrating this new API with the rest of your packages is probably best done by you. So if I understand correctly, you currently create I would remove that subscribe returns data. This looks unnecessary complication. So API would be somehow like:
I do not know when I will have time for this though. |
While working on #160, I noticed that the package is potentially processing equal documents in invalid way and potentially send multiple same (same _id) documents to the client unnecessary instead of merging it on the server.
Here you are pushing
collData
which is an array of documents onto a collection. In this way you get array of arrays. Later on you add arrays. And you push this array of arrays to the client, at least it seems so. There is no code which would be merging multiple documents with same _id together. At least I do not see it. You just combine arrays. And have arrays of arrays even.The second issue is that in the flow-router SSR you are deep-merging documents. This is wrong. Meteor does only top-level merging. This might introduce unnecessary incompatibilities.
The third issue is that you should probably validate inputs into the update call and check if there are any top-level keys which start with
$
. Because added/changed/removed calls do not check that you might get a document with those in, from bad code or malicious code.The text was updated successfully, but these errors were encountered: