-
Notifications
You must be signed in to change notification settings - Fork 1
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
Meta PR: Implement offline support #1239
Open
Ldoppea
wants to merge
86
commits into
master
Choose a base branch
from
feat/meta_offline
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
+6,616
−1,523
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
added a commit
to cozy/mespapiers
that referenced
this pull request
Aug 26, 2024
We want mespapiers to be compatible with the new Flagship app's Offline mode When hosted in a Flagship app's WebView we now want to use FlagshipLink instead of StackLink in cozy-client This link will allow to redirect all queries to the Flagship app that will handle data access when offline but also when online Related PR: cozy/cozy-client#1507 Related PR: cozy/cozy-flagship-app#1239
Ldoppea
added a commit
to cozy/mespapiers
that referenced
this pull request
Aug 27, 2024
We want mespapiers to be compatible with the new Flagship app's Offline mode When hosted in a Flagship app's WebView we now want to use FlagshipLink instead of StackLink in cozy-client This link will allow to redirect all queries to the Flagship app that will handle data access when offline but also when online Related PR: cozy/cozy-client#1507 Related PR: cozy/cozy-flagship-app#1239
5 tasks
🎉🎉 |
Ldoppea
added a commit
to cozy/mespapiers
that referenced
this pull request
Sep 13, 2024
We want mespapiers to be compatible with the new Flagship app's Offline mode When hosted in a Flagship app's WebView we now want to use FlagshipLink instead of StackLink in cozy-client This link will allow to redirect all queries to the Flagship app that will handle data access when offline but also when online Related PR: cozy/cozy-client#1507 Related PR: cozy/cozy-flagship-app#1239
Ldoppea
added a commit
to cozy/mespapiers
that referenced
this pull request
Sep 13, 2024
We want mespapiers to be compatible with the new Flagship app's Offline mode When hosted in a Flagship app's WebView we now want to use FlagshipLink instead of StackLink in cozy-client This link will allow to redirect all queries to the Flagship app that will handle data access when offline but also when online Related PR: cozy/cozy-client#1507 Related PR: cozy/cozy-flagship-app#1239
Ldoppea
added a commit
to cozy/cozy-home
that referenced
this pull request
Sep 16, 2024
We want cozy-home to be compatible with the new Flagship app's Offline mode When hosted in a Flagship app's WebView we now want to use FlagshipLink instead of StackLink in cozy-client This link will allow to redirect all queries to the Flagship app that will handle data access when offline but also when online Related PR: cozy/cozy-client#1507 Related PR: cozy/cozy-flagship-app#1239
Ldoppea
added a commit
to cozy/cozy-home
that referenced
this pull request
Sep 19, 2024
We want cozy-home to be compatible with the new Flagship app's Offline mode When hosted in a Flagship app's WebView we now want to use FlagshipLink instead of StackLink in cozy-client This link will allow to redirect all queries to the Flagship app that will handle data access when offline but also when online Related PR: cozy/cozy-client#1507 Related PR: cozy/cozy-flagship-app#1239
4 tasks
Ldoppea
added a commit
to cozy/cozy-home
that referenced
this pull request
Sep 24, 2024
We want cozy-home to be compatible with the new Flagship app's Offline mode When hosted in a Flagship app's WebView we now want to use FlagshipLink instead of StackLink in cozy-client This link will allow to redirect all queries to the Flagship app that will handle data access when offline but also when online Related PR: cozy/cozy-client#1507 Related PR: cozy/cozy-flagship-app#1239
Ldoppea
added a commit
to cozy/mespapiers
that referenced
this pull request
Sep 24, 2024
We want mespapiers to be compatible with the new Flagship app's Offline mode When hosted in a Flagship app's WebView we now want to use FlagshipLink instead of StackLink in cozy-client This link will allow to redirect all queries to the Flagship app that will handle data access when offline but also when online Related PR: cozy/cozy-client#1507 Related PR: cozy/cozy-flagship-app#1239
Ldoppea
added a commit
to cozy/mespapiers
that referenced
this pull request
Sep 25, 2024
We want mespapiers to be compatible with the new Flagship app's Offline mode When hosted in a Flagship app's WebView we now want to use FlagshipLink instead of StackLink in cozy-client This link will allow to redirect all queries to the Flagship app that will handle data access when offline but also when online Related PR: cozy/cozy-client#1507 Related PR: cozy/cozy-flagship-app#1239
Ldoppea
force-pushed
the
feat/meta_offline
branch
from
September 25, 2024 14:02
a2a1b6a
to
d0ae666
Compare
Ldoppea
force-pushed
the
feat/meta_offline
branch
from
December 11, 2024 14:35
b3b1a4b
to
9350c1f
Compare
Gemfile, Podfile and package.json updates come from React Native Upgrade Helper. Package updated to support RN0.73 : - @react-native-community/datetimepicker - react-native-svg-transformer - react-native-flipper react-native-flipper could be updated more but it is not working anyway for the moment so I just updated it to make it compile. `react-native run-android --variant=devDebug` CLI command has been changed to `react-native run-android --mode=devDebug`
Not linked to RN0.73 but to iOS 18. Solution inspired from ajith-ab/react-native-receive-sharing-intent#185 (comment)
This is needed to fix `ld: symbol(s) not found for architecture arm64` error on iOS CI This happens because Flipper is not meant to be built in release mode and because ReactNative removed direct support for Flipper since latest versions
`react-native-quick-sqlite` is enforced to version `8.0.6` in order to be compatible with RN0.72 Related article: https://dev.to/craftzdog/a-performant-way-to-use-pouchdb7-on-react-native-in-2022-24ej
By default, `react-native-performance-flipper-reporter` does not support custom measurement categories This commit patches `react-native-performance-flipper-reporter` so it will display as many categories as provided to the `rnperformances.measure()` method calls
Since our previous upgrades we can now use MMKV instead of AsyncStorage This migration is done in order to improve performances. MMKV being faster by multiple order of magnitude than AsyncStorage Code taken from #1097 Co-authored-by: Théo Poizat <[email protected]>
Since we migrated to MMKV, existing users' data should be migrated from the old AsyncStorage to MMKV Code taken from #1097 Co-authored-by: Théo Poizat <[email protected]>
In #1209 we added CozyPouchLink to CozyClient's instance By default CozyPouchLink starts replicating all its database directly after being initialized This is problematic as this happens during the App's startup and so it will unnecessary slow the startup process This is unnecessary because on startup, either the app is offline and so replication cannot be done, either the app is online and so it will use the cozy-stack. So replication can be delayed We want to defer the replication to a short delay after the startup (for now 30s)
Downloading important files on startup may slow down the startup process, so we want to delay it (for now 30s after the startup)
Call to `synchronize()` may slow down the startup process but is not necessary for the app to work It is here only to update the cozy-settings's OAuth clients list to display the last connexion to the app So we chose to delay this call a short delay after the startup (for now 10s) By doing so, we may fail calling the `synchronize()` method if the user closes the app less than 10s after opening it, but as this is used only for display purpose, we chose to consider this as not-critical
Icons caching may slow down the startup process but is not necessary for the app to work If not called in time, this would only impact cozy-apps opening animation that will use generic icons (if never called before) or potentially old icons (in the rare cases when we update a cozy-app icon) So we chose to delay this call a short delay after the startup (for now 30s)
With previous implementation, NetService would be configured too late and so it would have time to do reachability test on google servers before we configure it with Cozy's servers This commit move the configuration outside of the React components and so we ensure it is called as soon as possible
With previous implementation, NetService would do reachability tests too often and sometimes multiple times in parallel (as we can call `isOnline` from multiple parallel `client.query()` calls) This is problematic as it can unnecessary slow down the app processes This commit caches the isOnline result and register to the `NetInfo` event listener so stay up-to-date, so we can drastically reduce reachability tests on Cozy's servers
This upgrade is made possible due to recent RN73 upgrade and will allow to use `op-sqlite` instead of `react-native-quick-sqlite`
`cozy-client` and `cozy-pouch-link` has been upgraded to `52.0.0` in order to retrieve the ability to enforce StackLink usage for a query Related PR: cozy/cozy-client#1575
When doing a backup, we don't want instable network to make the CozyClient use local PouchLink for some queries that need to read files paths In cozy/cozy-client#1575 we implemented the `forceStack` option that allows to enforce the usage of StackLink instead of other links that may retrieve local incomplete data This commit enforce the stack on backup related queries Related PR: cozy/cozy-client#1575
Previous implementation was incorrect because `lastOpened` prop was stored as a string in the device's storage and so it was retrieved as string Then the date-fns `differenceInMonths` was failing comparing dates as it accepts only `Date` objects and no string This commit fixes this by parsing the persisted date into a `Date` and by fixing related TS typings
For some reasons, the ReactNative API fails to resolve `cozy-dataproxy-lib/api` path so we must use `/dist` version instead On the opposite, Jest will fail to resolve the `/dist` version so we cannot mock cozy-dataproxy-lib To fix this, we wrap the imports in a local file so we can mock this local file in Jest
Ldoppea
added a commit
to cozy/cozy-home
that referenced
this pull request
Jan 20, 2025
We want cozy-home to be compatible with the new Flagship app's Offline mode When hosted in a Flagship app's WebView we now want to use FlagshipLink instead of StackLink in cozy-client This link will allow to redirect all queries to the Flagship app that will handle data access when offline but also when online Related PR: cozy/cozy-client#1507 Related PR: cozy/cozy-flagship-app#1239
CozyClient.registerPlugin typing requires an `option` parameter to be defined But the RealtimePlugin expect this parameter to be optional or to be an object If `null` is given, then the application would crash. We injected `null` in #1279 because the CI did reject the initial attempt with no parameter, but this was not the correct solution, the correct one would be to inject an empty object In the future we may want to make this parameter optional in the `registerPlugin` definition
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.
This PR is a temporary "main" for all Offline features until everything is ready to be merged into our main branch
PR List:
{}
instead ofnull
as second parameter of RealtimePlugin #1281Related PRs:
downloadFile()
method from cozy-client cozy-ui#2690TODO: