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

Meta PR: Implement offline support #1239

Open
wants to merge 85 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
85 commits
Select commit Hold shift + click to select a range
26d600a
feat(RN0.73): Update packages
zatteo Oct 10, 2024
d525f7b
feat(RN0.73): Use new @react-native/babel-preset
zatteo Oct 10, 2024
9ce5fca
feat(RN0.73): Update Android build files
zatteo Oct 10, 2024
d1bb437
feat(RN0.73): Update iOS build files
zatteo Oct 10, 2024
ca7bd9a
feat(RN0.73): Update Flipper setup
zatteo Oct 10, 2024
3eff0bd
feat(RN0.73): Upgrade CI to node 20
zatteo Oct 10, 2024
0e5aca2
refactor(RN0.73): Remove style props not understood by RN
zatteo Oct 10, 2024
105b698
docs(RN0.73): Update types after RN update
zatteo Oct 10, 2024
7d00852
feat: Update ShareViewController to support iOS 18
zatteo Oct 17, 2024
7a41c31
fix: Disable Flipper in iOS release builds
Ldoppea Nov 18, 2024
bb73393
feat: Add react-native modules for PouchDB
Ldoppea May 22, 2024
9209d05
feat: Configure PouchDB to run on the project
Ldoppea May 28, 2024
c2387d4
feat: Add cozy-pouch-link module
Ldoppea May 28, 2024
4e067f3
feat: Configure CozyClient to use CozyPouchLink
Ldoppea May 31, 2024
26e731d
feat: Configure CozyClient to also use StackLink (when online)
Ldoppea May 31, 2024
27436dc
feat: Add PouchDBFind plugin to the PouchDB configuration
Ldoppea May 31, 2024
b3984d9
feat: Add clientCachedStorage to handle CozyClient's requests cache
Ldoppea Jul 11, 2024
435799c
feat: Cache `/apps/:slug/open` request for offline support
Ldoppea Jul 11, 2024
43df99e
feat: Upgrade cozy-intent to `2.23.0`
Ldoppea Sep 24, 2024
2b421fa
feat: Implement FlagshipLinkRequest interface through localMethods
Ldoppea Jul 30, 2024
dc753f9
feat: Enable CacheMode for CozyProxyWebView on android when offline
Ldoppea Jul 11, 2024
4d7c460
feat: Ignore queries warmup on PouchLink
Ldoppea Jul 30, 2024
1678258
feat: Declare schemas into cozy-client instance
Ldoppea Jul 26, 2024
21ad737
feat: Add react-native-mail plugin
Ldoppea Jul 26, 2024
2bd4f08
feat: Allow to send Pouch databases through email for debug purpose
Ldoppea Jul 26, 2024
00145a4
feat: Declare offline support in cozy-apps injected metadata
Ldoppea Jul 30, 2024
7394c95
feat: Prevent local PouchDB modification to be replicated to remote DB
Ldoppea Sep 13, 2024
e92554d
feat: Add `downloadFile` in localMethods and handle offline files
Ldoppea Aug 8, 2024
12c1cf4
feat: Make import files automatically available offline
Ldoppea Aug 8, 2024
c8913a5
feat: Clean non-important offline files when too old
Ldoppea Aug 8, 2024
32bacfd
feat: Use NetStatusBoundary only when logged out
Ldoppea Aug 22, 2024
0546007
fix: Set correct return objects for `getIndexHtmlForSlug`
Ldoppea Aug 22, 2024
f8558ba
feat: Enable offline mode only for cozy-home and mespapiers
Ldoppea Aug 22, 2024
7778abc
feat: Display an error message when opening unsupported offline cozy-app
Ldoppea Aug 22, 2024
f152171
feat: Enable HttpServer on iOS when offline
Ldoppea Aug 22, 2024
61f6aa8
feat: Open cozy-app when offline only if it supports Offline mode
Ldoppea Sep 13, 2024
2f11214
docs: Document how to make a cozy-app compatible with Offline mode
Ldoppea Sep 13, 2024
ef7e8fd
refactor: Handle SendDb deeplink in its own hook
Ldoppea Sep 15, 2024
059c3ec
feat: Allow to reset local PouchDB using UniversalLinks
Ldoppea Sep 15, 2024
d909645
feat: Display an error dialog when trying to download a file offline
Ldoppea Sep 24, 2024
c4ba49a
feat: Allow cozy-apps to verify if offline file downloading is available
Ldoppea Sep 24, 2024
1419b66
fix: Skip io.cozy.jobs queries
Ldoppea Sep 24, 2024
f895a92
docs: Document how to debug Offline mode
Ldoppea Sep 24, 2024
82e6204
docs: Update docs' table of content
Ldoppea Sep 24, 2024
09276f6
fix: Upload DB files to the Cozy instead of sending them by email
Ldoppea Oct 1, 2024
9a09a1b
fix: Remove unused plugin rn-fetch-blob
Ldoppea Oct 1, 2024
d177e13
feat: Upgrade cozy-pouch-link to `49.1.0`
Ldoppea Oct 3, 2024
b74d9b9
feat: Upgrade cozy-client and cozy-pouch-link
Ldoppea Dec 20, 2024
0951656
feat: Add react-native-performance module
Ldoppea Nov 20, 2024
59ed6fa
feat: Add performance measurements
Ldoppea Sep 26, 2024
e2b50aa
feat: Upgrade cozy-client and cozy-pouch-link to `51.7.0`
Ldoppea Dec 20, 2024
07363b5
feat: Enable performances measurements to CozyClient and links
Ldoppea Dec 18, 2024
d167451
feat: Add performances measurements to Redux package
Ldoppea Dec 4, 2024
72fdbc9
feat: Allow to send Performance logs through email for debug purpose
Ldoppea Nov 25, 2024
3d0acc9
feat: Change file name format when sending PouchDB files by email
Ldoppea Dec 4, 2024
137927c
feat: Add conversion script to allow opening logs in Chrome devtools
Ldoppea Nov 26, 2024
763774e
feat: Improve conversion script to handle native measurements
Ldoppea Jan 9, 2025
83010cf
feat: Patch rn-performance-flipper-reporter to handle custom categories
Ldoppea Nov 26, 2024
1bd2a8a
doc: Add documentation for debugging performances
Ldoppea Jan 16, 2025
c6a0b06
feat: Add react-native-mmkv plugin
Ldoppea Nov 25, 2024
6df4bcb
feat: Migrate storage from AsyncStorage to MMKV
Ldoppea Nov 25, 2024
4d21ea6
feat: Add performance measurements on MMKV migration script
Ldoppea Dec 19, 2024
17e71ab
feat: Migrate clientCacheStorage from AsyncStorage to MMKV
Ldoppea Dec 20, 2024
74bb38b
feat: Migrate Redux store from AsyncStorage to MMKV
Ldoppea Dec 4, 2024
d4c67f9
feat: Migrate Offline's platform storage from AsyncStorage to MMKV
Ldoppea Dec 4, 2024
b841d60
feat: Debounce PouchDB replication
Ldoppea Nov 26, 2024
be2e8a8
feat: Delay important files downloading 30s after startup
Ldoppea Nov 26, 2024
fe47cfd
feat: Delay clients `synchronize()` call 10s after startup
Ldoppea Nov 27, 2024
008c77a
feat: Delay icon's caching manager 30s after startup
Ldoppea Dec 4, 2024
31635cf
fix: Configure NetService reachabilityUrl earlier on app startup
Ldoppea Dec 4, 2024
ef34b92
feat: Add cache for NetService state
Ldoppea Dec 4, 2024
b1c5f3f
feat: Upgrade pouchdb-adapter-react-native-sqlite to v4
Ldoppea Nov 12, 2024
d58a315
fix: Enforce OpenSSL-Universal for iOS build
Ldoppea Nov 12, 2024
da02888
feat: Upgrade cozy-client and cozy-pouch-link to `52.0.0`
Ldoppea Dec 20, 2024
56beaad
fix: Enforce Stack queries when doing backup
Ldoppea Dec 20, 2024
e656f8f
fix: Correctly handle removal of unimportant cached files
Ldoppea Dec 18, 2024
bfe322b
feat: Remove old hack for DefaultRedirectionUrl migration
Ldoppea Dec 20, 2024
564d9c5
feat: Add cozy-realtime package
Ldoppea Jan 12, 2025
b9abca0
refactor: Move `triggerPouchReplication()` code into its own file
Ldoppea Jan 12, 2025
ecd3c04
feat: Trigger PouchDB replication when apps is restored from background
Ldoppea Jan 12, 2025
022657e
feat: Register CozyRealtime plugin into CozyClient
Ldoppea Jan 12, 2025
1f0982c
feat: Trigger PouchDB replication when realtime event is received
Ldoppea Jan 12, 2025
2ded6a0
feat: Add cozy-dataproxy-lib package
Ldoppea Jan 12, 2025
da68c43
feat: Implement search feature
Ldoppea Jan 12, 2025
341150d
fix: Wrap cozy-dataproxy-lib imports in a mockable file
Ldoppea Jan 16, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
docs: Document how to debug Offline mode
  • Loading branch information
Ldoppea committed Dec 19, 2024
commit f895a926526d336bbb3bbae92eb39d590e90d3d0
44 changes: 44 additions & 0 deletions docs/how-to-debug-offline-mode.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# How to debug Offline mode

The Flagship app now handle Offline mode, this means that it can be open and run while the device is offline

This features implies that we can debug the app while using an offline device. This document explains how to do it

## Android emulator

On android, in order to set the device offline, use the top drawer menu, open the `Internet` menu and then disable both the Mobile Data and the Wi-Fi entries

Since ReactNative 0.72, the ReactNative debug link won't work by default if the emulator is offline. This can be fixing by running the following commands from a terminal while the emulator is running:
- `adb root`
- `adb reverse tcp:8081 tcp:8081`
- `adb shell setprop metro.host "localhost"`

When executed, those commands allow to build, deploy and hot-reload the ReactNative app from an offline emulator. The debug console is also functional

## iOS simulator

iOS simulator seems not to provide a comfortable way to debug the app offline. The only way to set the simulator offline is to set the entire computer offline, but this is not an acceptable solution is we are debuging using a locally running cozy-stack as it will still be reachable by the simulator

## Physical devices

On physical iOS and Android device, it is possible to debug the app by setting the device offline

However this will break build, hot-reload and console debugging features

To mitigate this, it is possible to use Universal Links to extract console logs and DB files from the device

For console logs, please refer to [How to retrieve logs in release mode](how-to-retrieve-logs-in-release.md) documentation

For DB files, it is possible to send them by email using the following link:

- https://links.mycozy.cloud/flagship/senddb or [cozy://senddb](cozy://senddb)
- trigger the OS send email intent pre-filled with DB files and Cozy's support email

## Reset local PouchDB

While debugging offline features, it is possible to corrupt the local PouchDB files (i.e. by injecting non valid documents)

It is possible to reset the local PouchDB files using the following link:

- https://links.mycozy.cloud/flagship/resetdb or [cozy://resetdb](cozy://resetdb)
- Reset the local PouchDB and restart the app