cozy / cozy-client

Document store and React components for the Cozy platform
MIT License
13 stars 13 forks source link

feat: Make Pouch replication work with react-native #1504

Closed Ldoppea closed 1 month ago

Ldoppea commented 3 months ago

In previous PRs we implemented react-native support for CozyPouchLink

Some of the doctypes we want to replicate may not always exist in remote database. This is the case for io.cozy.accounts that do not exist until the first konnector is configured. When this happens we want the replication process to be resilient and the react-native app to still serve data when offline

Some other doctypes are protected by the remote cozy-stack. When this is the case we still want to have a local Pouch to store cozy-stack answers and make them available offline. This is not a real replication but is considered as is in the code.

This PR adapts the Pouch replication process to those new needs and also make it more robust by fixing some historic bugs