githubbob42 / mingle2github2

0 stars 1 forks source link

Change eventstore sync behavior #5129

Open githubbob42 opened 6 years ago

githubbob42 commented 6 years ago

Mingle Card: 5483 Description

Currently during sync, all of the events are fetched from the store and sent over the wire.  Then the event store is completely cleared.  This send and wipe strategy could be dangerous when post is a backgrounded process where events are being written as the sync process is happening.

Acceptance Criteria

If I sync while other operations are happening, no event data should be lost.

Analysis

Change the event store clear method to only clear events it is asked to.

Related Stories

Make sure that we handle the case in card #5565 when we lose network connection during the upload.

Tasks

{{ table query: SELECT Number, Name, Owner, 'Task Status' WHERE Type = Task and Story = THIS CARD ORDER BY Status }}

Defects

{{ table query: SELECT Number, Name, Owner, 'Status' WHERE Type = Defect and 'Related Story' = THIS CARD }}

Test Plan
 

Tarantula > Sync - Upload Only 

Not all data posted to backoffice when sync interrupted and upload only button used after connecting to the internet

  1. login to mobile 
  2. create a job, ticket and add some ticket items
  3. initiate sync then before sync completes disconnect from the network
  4. while disconnected from network create another ticket on the job from step 2 
  5. connect to the network
  6. sync and upload buttons will become enabled; click ‘Upload Only’ button

    Expected Result

    data created before sync was interrupted and data created during offline period should be synced to the backoffice

    Actual Result

    data created before sync was interrupted does not make it to the backoffice; 
    there would be 2 audit logs (Pre Sync upload) with attachments that list all data that was created, 
    but only data from second audit log (created during off line time) will be posted to the backoffice

githubbob42 commented 6 years ago

Pull Request #2722