Comments (7)
Fixed with version 2.
"uniqueIdentifierName" links the documents to the subscription for purpose of synchronization
When MO goes offline, "things" are populated from offline redux store
When MO comes online again, added
"things" (ddp) are compared with offline things, ones that don't exist anymore are removed from minimongo and redux.
MO.subscribe('uniqueIdentifierName', 'subscriptionName', ...params, callback);
const things = MO.collection('things', 'uniqueIdentifierName').find();
from react-native-meteor-offline.
Yep, that's pretty accurate.
from react-native-meteor-offline.
@JulianKingman what happens now with "App Startup", if there's a connection to Meteor... ie goes it "burn with fire" the redux store/disk and replenish redux/disk?
Ie I expect thats probably the simplest approach (in a very complex online/offline sync/merge/resolve-conflicts world). ie when you're offline you won't be getting any DDP add/change/delete, so when you come back online you need refresh things.
I guess the big question is what happens with conflicts?
BTW, a bit confused on the Realm Branch... is there an overview beyond the very basic setup in the branch's read me, please? ie is this only for new apps that are using Realm from the getGo, or does it replace Redux and can be used with an existing Meteor app?
from react-native-meteor-offline.
Thanks, Julian
from react-native-meteor-offline.
@adamgins burn-with-fire would be the simplest, but it's quite expensive to save data, so I'm trying to see if a more intelligent solution is possible.
For conflicts, any records that are different on the app are overwritten by the remote versions. I don't have immediate plans to support write operations, so that shouldn't be a problem.
The realm branch uses realm instead of redux. There are pros and cons to this. It should be faster, but it requires native linking, which you can't do in expo, for example. So long as you install realm properly, you should be able to integrate it. A couple people are having issues with it atm though, and I haven't been able to trace the problem.
from react-native-meteor-offline.
Thanks.
As opposed to the burn-with-fire, you'd probably have to check last modified date on each document and maintain some sort of replication log.
Wondering if we could borrow from Meteor here as it already has this issue solved with minimongo, that said I don't currently know how that works under the covers?
from react-native-meteor-offline.
Checking if a document has changed is not a big problem, the problem is finding out if a document has been removed from the server. The ideal option would know which documents you're subscribed to, and notice if documents are missing. Unfortunately there's no way to tell what subscription brought in a particular document.
from react-native-meteor-offline.
Related Issues (20)
- Last Redux State is not written to disk HOT 5
- _.clone(state) or _.cloneDeep(state.prop) HOT 4
- How to write record HOT 2
- [Error] Expected listener to be a function HOT 2
- Crash when subscribing HOT 1
- How to sync inserts/updates after resuming connection HOT 3
- Package not bundling HOT 3
- Unable to resolve module 'redux-persist' when trying to npm link HOT 1
- 'cleared' field ignored in ddp event listeners HOT 3
- Can't get online insert to work HOT 1
- Create user issues HOT 1
- Subsciptions keep on reloading HOT 1
- MO.user() after successful Meteor.logout() then go offline.
- TypeError: undefined is not an object (evaluating '(0, _reactNativeMeteor.getData)().db[collection].remove') HOT 1
- Cleanup method needed when user logged out and new one connected HOT 3
- undefined is not an object (evaluating 'state[collection][id]') HOT 2
- offline property of MeteorOffline is always false
- with expo sdk32 : invalid attempt to spread non-iterable instance HOT 6
- Can you give me the example of a function component? HOT 1
- Upgrade to meteorrn/core HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-native-meteor-offline.