Uploaded image for project: 'AeroGear'
  1. AeroGear
  2. AEROGEAR-8333

[DataSync] No optimistic updates for failed replayOfflineMutations

XMLWordPrintable

      Example:

      1. start apollo-voyager-ionic-example (including server)
      2. go offline
      3. create a task
      4. kill server
      5. refresh page
      6. go online
      7. local storage still contains failed replayed offline mutation
      8. but it is not visible in app

      Edit (by pahayes@redhat.com): There is also another way to see the same bug.

      1. Start apollo-voyager-ionic-example on a real mobile device (including server)
      2. Create some tasks while online
      3. Go offline
      4. Create a task 'Created while offline'
      5. Create another task and also update it. 'Created and updated while offline'
      6. Update a task that existed before you went offline
      7. Force close the app
      8. Reopen the app while still offline
      9. You will see your update on the task that existed before you went offline.
      10. You will not see your tasks you created while offline
      11. In the chrome debugger you can navigate to the Application tab and look at the local storage for the app and you will see in the offline mutation queue that your mutations are still in the queue but you can no longer see them on the screen

      Solutions

      Persist required data to build optimistic response and update functions (as they are linked together)
      Within SDK we have helper for providing optimistic responses.
      Update functions are mostly hard to write and require boilerplate code.

      How this will work

      We can provide helper method for building update function based on the optimisticResponse format.
      The same helper can be later used to restore state.

      Going to provide concept and early PR soon.

            wtrocki@redhat.com Wojciech Trocki
            jhellar@redhat.com Jan Hellar (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: