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

fix: Applies PRs change requests for Offline mode #1524

Merged
merged 14 commits into from
Sep 9, 2024

Conversation

Ldoppea
Copy link
Member

@Ldoppea Ldoppea commented Sep 4, 2024

This PR applies change requests from previous PRs on Offline mode

See all commit messages for more details


Related PRs:

@Ldoppea Ldoppea changed the title Fix: Applies PR requests for Offline mode Fix: Applies PRs change requests for Offline mode Sep 4, 2024
@Ldoppea Ldoppea force-pushed the fix/offline_reviews_feedbacks branch 2 times, most recently from ded3440 to 67db2ab Compare September 5, 2024 07:46
Copy link
Contributor

@paultranvan paultranvan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice work 👍

@Ldoppea Ldoppea changed the title Fix: Applies PRs change requests for Offline mode fix: Applies PRs change requests for Offline mode Sep 9, 2024
@Ldoppea Ldoppea force-pushed the feat/download_files_flagship branch from 7b1ae64 to ce57209 Compare September 9, 2024 13:41
Base automatically changed from feat/download_files_flagship to feat/meta_offline September 9, 2024 13:50
In order to prevent implementation errors, we want to check that
storageEngine implements the correct methods

This replies to #1483 (comment)
We want to extract this code logic into its own method in order to ease
readability and testing

Also we refactored the code to make it easier to read

This replies to #1506 (comment)
This commit is a copy of #1517 applied to CozyPouchLink

When specifying fields in a query, e.g.
`Q('io.cozy.todos').where({done: true}).select(['date'])`, the revision
was missing if not explicitly given. This is now problematic because we
rely on the revision existence to identify "virtual" documents, i.e. not
persisted in CouchDB, that never have any revision.
See #1486 for more insights.
With CouchDB, it is possible to make a mango query on an index without
having any predicate on an sorted field in the selector

It is not possible with PouchDB that requires to have any sorted
fields to be in the selector

We automatically handle that to avoid breaking existing queries
This guard has been added to handle documents with no `meta.rev` but
since we added a check on `_rev` (in addition to `meta.rev`) to trigger
the persistence, then we don't need this guard anymore

This replies to #1486 (comment)

Related commit: b797eb3
Related commit: 62290ed
Previous implementation was from a misunderstanding of CozyPouchLink
mechanisms

As we don't need to specify warmup queries in CozyPouchLink
instanciation, we don't need the `ignoreWarmup` as we would result to
the same behavior of having no warmup queries

Warmup queries concept is meant to be removed into the future as we
won't be able to use them when offline and the scenario that needed
them (cozy-banks and cozy-drive apps) does not exist anymore

This replies to #1506 (comment)

Related commit: bb43ae9
@Ldoppea Ldoppea force-pushed the fix/offline_reviews_feedbacks branch from 67db2ab to ce86492 Compare September 9, 2024 13:52
@Ldoppea Ldoppea merged commit 3eb3aa7 into feat/meta_offline Sep 9, 2024
2 checks passed
@Ldoppea Ldoppea deleted the fix/offline_reviews_feedbacks branch September 9, 2024 14:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants