-
Notifications
You must be signed in to change notification settings - Fork 12
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
stack-client: Collections attributes duplication #1118
Comments
This is not a problem restricted to the files but to other collections as well, AppCollection, ContactCollection, etc. So the issue is even worse |
Real time provides an object with attributes at the root. When cozy-client merged it with the last request stored in the store, the properties were doubled with those in the object property. I decided to flatten the attributes property to have a single data source. See also #1118
Real time provides an object with attributes at the root. When cozy-client merged it with the last request stored in the store, the properties were doubled with those in the object property. I decided to flatten the attributes property to have a single data source. See also #1118
I've encountered the same problem with SettingsCollection. I made a PR to temporarily fix the problem locally with duplication. I'm wondering how to make the transition to an api without attributes. I thought we could :
the disadvantage of this strategy is the temporary increase in the size of the redux store how do you see it? |
Realtime provides an object with attributes at the root, whereas in query result, attributes are a property in themselves. When cozy-client tries to merge them, only the root attributes are updated. When normalising, I now spread attributes at the root so that I can access to a data that is always up to date.property. I decided to flatten the attributes property to have a single data source. See also #1118
Realtime provides an object with attributes at the root, whereas in query result, attributes are a property in themselves. When cozy-client tries to merge them, only the root attributes are updated. When normalising, I now spread attributes at the root so that I can access to a data that is always up to date.property. I decided to flatten the attributes property to have a single data source. See also #1118
Realtime provides an object with attributes at the root, whereas in query result, attributes are a property in themselves. When cozy-client tries to merge them, only the root attributes are updated. When normalising, I now spread attributes at the root so that I can access to a data that is always up to date.property. I decided to flatten the attributes property to have a single data source. See also #1118
I'm reading this issue again, and if I understand you correctly @cballevre at the end, we'll remove the existence of Maybe we should resume what are the responses from the stack and see how we can handle them. |
Currently, when we duplicate all the attributes at the root of the object: https://github.com/cozy/cozy-client/blob/master/packages/cozy-stack-client/src/FileCollection.js#L66-L69
The result is that we have big object since we have twice all the attributes. Since attribute also contains cozyMetadata (https://docs.cozy.io/en/cozy-stack/files/#get-filesfile-id) it can be huge...
Also, when an io.cozy.files come from the Realtime, it doesn't have this
attributes
key because thisattr
is added by the stack on this special/files/
endpoint.Comment from "ui": cozy/cozy-ui#2033 (comment)
The text was updated successfully, but these errors were encountered: