-
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
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Ldoppea
force-pushed
the
fix/offline_reviews_feedbacks
branch
from
September 4, 2024 16:11
813017e
to
ded3440
Compare
Ldoppea
force-pushed
the
fix/offline_attributes
branch
from
September 4, 2024 16:13
8708811
to
21eaf5f
Compare
Ldoppea
force-pushed
the
fix/offline_reviews_feedbacks
branch
from
September 5, 2024 07:46
ded3440
to
67db2ab
Compare
Ldoppea
force-pushed
the
fix/offline_attributes
branch
from
September 5, 2024 07:46
21eaf5f
to
04ad0eb
Compare
Ldoppea
force-pushed
the
fix/offline_reviews_feedbacks
branch
from
September 9, 2024 13:52
67db2ab
to
ce86492
Compare
Base automatically changed from
fix/offline_reviews_feedbacks
to
feat/meta_offline
September 9, 2024 14:08
Ldoppea
force-pushed
the
fix/offline_attributes
branch
from
September 9, 2024 14:09
04ad0eb
to
54669fd
Compare
Ldoppea
force-pushed
the
feat/meta_offline
branch
from
September 9, 2024 14:25
3eb3aa7
to
4f3e14e
Compare
Ldoppea
force-pushed
the
fix/offline_attributes
branch
3 times, most recently
from
September 11, 2024 15:04
6c25810
to
6c09399
Compare
paultranvan
approved these changes
Sep 12, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Those 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)
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
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`
Calls of those methods have been checked and `instanceInfo` parameter is always a result of `useInstanceInfo` so we know that `.attributes` can be omited
Ldoppea
force-pushed
the
fix/offline_attributes
branch
from
September 12, 2024 15:17
6c09399
to
75bd960
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Those 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 ofattributes
in cozy-client will be done after this oneUsage of
attributes
andmeta
members on cozy-app will also have to be fixed. This will be a requirement to implement Offline mode on cozy-appsRelated PRs: