-
Notifications
You must be signed in to change notification settings - Fork 13
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
fix: Remove attributes and meta attributes before persisting docs #1525
Merged
Commits on Sep 12, 2024
-
fix: Remove
attributes
andmeta
attributes before persisting docsThose doc's attributes are specific to the JSON API and should not be inserted into the Pouch database This implies that we will have a difference on documents regarding if they are served through the cozy-stack or through a local PouchDB, the first one may include those fields in their result, but not the second one So from now we should avoid, as much as possible, to relies on the `attributes` member to prevent bugs on Offline mode. Multiple commits to fix usages of `attributes` in cozy-client will be done after this one Usage of `attributes` and `meta` members on cozy-app will also have to be fixed. This will be a requirement to implement Offline mode on cozy-apps This replies to #1486 (comment)
Configuration menu - View commit details
-
Copy full SHA for 3ec3450 - Browse repository at this point
Copy the full SHA 3ec3450View commit details -
Configuration menu - View commit details
-
Copy full SHA for d201932 - Browse repository at this point
Copy the full SHA d201932View commit details -
Configuration menu - View commit details
-
Copy full SHA for 0a51ff1 - Browse repository at this point
Copy the full SHA 0a51ff1View commit details -
fix: Don't use attributes on useCapabilities
By doing so we add unnecessary values to the capabilities object that will now contain more data than just `.attributes` As those are supernumerary values we consider that this is not problematic, but we may want to find a cleaner solution in the future
Configuration menu - View commit details
-
Copy full SHA for a4c3575 - Browse repository at this point
Copy the full SHA a4c3575View commit details -
Configuration menu - View commit details
-
Copy full SHA for 7327578 - Browse repository at this point
Copy the full SHA 7327578View commit details -
fix: Don't use attributes on models/applications
Calls of `isInstalled` and all related methods have been checked and `apps` parameter is always a result of `client.query()` so we know that `.slug` can be used in replacement of `.attributes.slug`
Configuration menu - View commit details
-
Copy full SHA for 9573fb8 - Browse repository at this point
Copy the full SHA 9573fb8View commit details -
fix: Don't use attributes on models/instance
Calls of those methods have been checked and `instanceInfo` parameter is always a result of `useInstanceInfo` so we know that `.attributes` can be omited
Configuration menu - View commit details
-
Copy full SHA for d810982 - Browse repository at this point
Copy the full SHA d810982View commit details -
Configuration menu - View commit details
-
Copy full SHA for 75bd960 - Browse repository at this point
Copy the full SHA 75bd960View commit details
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.