You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Mar 24, 2021. It is now read-only.
Copy file name to clipboardExpand all lines: docs/conflict_resolution.md
+26-24Lines changed: 26 additions & 24 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,21 +2,25 @@
2
2
3
3
### Steps to support Conflict Resolution in your app:
4
4
5
-
- Create a class, let say `UserConflictResolutionHandler` which extends ConfliceResolutionInterface provided by the library.
5
+
- Create a class, let say `UserConflictResolutionHandler` which implements `ConfliceResolutionInterface` provided by the library.
6
6
- Override the `resolveConflict()` method of the interface in your class.
7
7
- You get the **`server state`** and the **`client state`** data associated with that mutation in which conflict occurred.
8
8
- You also get the **`operation type`** of the conflicted mutation. Run a switch case on the operation type to detect which type of mutation is it in which conflict occured and accordingly create an object of that mutation while resolving conflicts.
9
9
- You can resolve conflicts based on your business logic and again make a call to the server.
10
10
11
+
#### The [conflict protocol/structure](https://offix.dev/#/ref-conflict-server?id=structure-of-the-conflict-error) is descibed on [offix.dev](https://offix.dev/)
12
+
13
+
11
14
### Code:
15
+
#### The sample app contains conflict resolution based on the version strategy. However, the user can use their own markers to resolve conflicts.
@@ -36,3 +37,6 @@ For **maven**, add the following dependency: <br/>
36
37
<type>pom</type>
37
38
</dependency>
38
39
```
40
+
41
+
42
+
#### Note: The library works with the offix-sever that is node.js based and [conflict protocol](https://offix.dev/#/ref-conflict-server?id=structure-of-the-conflict-error) is descibed on [offix.dev](https://offix.dev/)
Copy file name to clipboardExpand all lines: docs/test_offline.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,6 +2,6 @@
2
2
3
3
- Create any mutation. (Procedure shown on previous page)
4
4
- If your network is connected, then you will get a successful reponse from the server in ApolloCalback's `onResponse()` method. You can perfrom UI Bindings here according to your needs.
5
-
- If your network is not connected, a toast will be shown regarding the same and your mutation would be successfully stored in an offline store.
5
+
- If your network is not connected, your mutation will be successfully stored in an offline store.
6
6
- Once your network connection is regained, the mutations done when you were offline will try to replicate back to the server till all the offline mutations successfully hit the server and you get a response back from them.
7
7
- To get the most recent data in your application, **refresh** your app once after the network comes back by swiping down on the screen.
0 commit comments