Uploaded image for project: 'Couchbase Lite'
  1. Couchbase Lite
  2. CBL-623

Revision flags get cleared while saving resolved document in Java

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.7.0
    • 2.8.0
    • Java-Android
    • Security Level: Public
    • None

    Description

      Java clears the revision flags in its saveResolvedDocument function
      CBL / SG Version: Android - 2.7.0-255 , iOS - 2.7.0-99, SGW - 2.7.0-165
      *Steps to Reproduce: *
      1..Net client as user1 created new list and task with attachment and shared with user2(Android client)
      2. Both clients went offline.
      3. User1 updated image and marked as complete
      4. user2 edited the name of the same task with new name
      5. both clients came online

      Steps from Jim from his point of view :
      Start with a synced document between two devices at the same rev
      Go offline with both
      Make at least one change on device 1 with no blob change
      Make more than one change on device 2 with a blob change
      Bring device 1 online, so it syncs first
      Bring device 2 online, so its sync will get 409
      SG sends device 2 rev 7 which will cause a pull conflict
      Java conflict resolution handler accidentally clears the attachment flag on the new revision
      LiteCore doesn't send the _attachments dictionary since the rev doesn't have the attachment flag

      Actual Result:
      6. User1 and user2 had the task marked as complete, but has old image which attached while created new task at step 1

      Expected Result: user1 and user2 should have image updated and mark the task 'checked' as user1 wins with default conflict resolution

      Note : Did not provide any logs as we tracked down the issue

      Attachments

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            sridevi.saragadam Sridevi Saragadam created issue -
            sridevi.saragadam Sridevi Saragadam made changes -
            Field Original Value New Value
            Link This issue is cloned by CBL-624 [ CBL-624 ]
            blake.meike Blake Meike added a comment -

            Fixed in couchbase-lite-java: 895128056f09b74634

            blake.meike Blake Meike added a comment - Fixed in couchbase-lite-java: 895128056f09b74634
            blake.meike Blake Meike made changes -
            Resolution Fixed [ 1 ]
            Status Open [ 1 ] Resolved [ 5 ]
            sridevi.saragadam Sridevi Saragadam made changes -
            CVSS/Severity Critical [ 11152 ] High [ 11153 ]
            sridevi.saragadam Sridevi Saragadam made changes -
            Summary Conflict resolution clears revision flags in Java Revision flags get cleared while saving resolved document in Java
            jimb Jim Borden made changes -
            CVSS/Severity High [ 11153 ]
            jimb Jim Borden made changes -
            Required Mobile Fields Mandatory:
             - CBL / SG Version:
               - SG Config:
             - Steps to Reproduce:
             - Actual Result:
             - Expected Result:
             - Logs :
                  SGW LOGS: sgcollect info
                  CBL LOGS:
                  Logcat LOGS: for Android tickets
             - Github link for the code:
             - Jenkins job failure link:
             - Pytest Command
             - What is the last build this test passed:
            jimb Jim Borden made changes -
            Description Java clears the revision flags in its saveResolvedDocument function
            *CBL / SG Version:* Android - 2.7.0-255 , iOS - 2.7.0-99, SGW - 2.7.0-165
            *Steps to Reproduce: *
            1..Net client as user1 created new list and task with attachment and shared with user2(Android client)
            2. Both clients went offline.
            3. User1 updated image and marked as complete
            4. user2 edited the name of the same task with new name
            5. both clients came online


            Steps from Jim from his point of view :
            Start with a synced document between two devices at the same rev
            Go offline with both
            Make at least one change on device 1 with no blob change
            Make more than one change on device 2 with a blob change
            Bring device 1 online, so it syncs first
            Bring device 2 online, so its sync will get 409
            SG sends device 2 rev 7 as a delta
            Device 2 takes the "delta with no additional blobs" branch of IncomingRev
            Device 2 saves rev 7 without kRevHasAttachments
            Device 2 resolves the conflict by creating rev 8
            Device 2 consults rev 7's flags to find out if it needs to send _attachments (otherwise it thinks it has no blobs in the body)
            Device 2 sends a rev message to SG without the _attachments

            *Actual Result:*
            6. User1 and user2 had the task marked as complete, but has old image which attached while created new task at step 1

            *Expected Result:* user1 and user2 should have image updated and mark the task 'checked' as user1 wins with default conflict resolution

            Note : Did not provide any logs as we tracked down the issue

            Java clears the revision flags in its saveResolvedDocument function
             *CBL / SG Version:* Android - 2.7.0-255 , iOS - 2.7.0-99, SGW - 2.7.0-165
             *Steps to Reproduce: *
             1..Net client as user1 created new list and task with attachment and shared with user2(Android client)
             2. Both clients went offline.
             3. User1 updated image and marked as complete
             4. user2 edited the name of the same task with new name
             5. both clients came online

            Steps from Jim from his point of view :
            Start with a synced document between two devices at the same rev
             Go offline with both
             Make at least one change on device 1 with no blob change
             Make more than one change on device 2 with a blob change
             Bring device 1 online, so it syncs first
             Bring device 2 online, so its sync will get 409
             SG sends device 2 rev 7 which will cause a pull conflict
            Java conflict resolution handler accidentally clears the attachment flag on the new revision
            LiteCore doesn't send the {{_attachments}} dictionary since the rev doesn't have the attachment flag

            *Actual Result:*
             6. User1 and user2 had the task marked as complete, but has old image which attached while created new task at step 1

            *Expected Result:* user1 and user2 should have image updated and mark the task 'checked' as user1 wins with default conflict resolution

            Note : Did not provide any logs as we tracked down the issue

            Blake Meike, so we have a new RC for Mercury?

            daniel.petersen Daniel Petersen added a comment - Blake Meike , so we have a new RC for Mercury?
            blake.meike Blake Meike added a comment -

            Daniel Petersen: not unless at least you (and perhaps Priya Rajagopal?) agree that this is a Mercury blocker.

            blake.meike Blake Meike added a comment - Daniel Petersen : not unless at least you (and perhaps Priya Rajagopal ?) agree that this is a Mercury blocker.

            Build couchbase-lite-java-2.8.0-26 contains couchbase-lite-java-ee commit 27da84f with commit message:
            Merge pull request #17 from couchbaselabs/bug/CBL-623

            build-team Couchbase Build Team added a comment - Build couchbase-lite-java-2.8.0-26 contains couchbase-lite-java-ee commit 27da84f with commit message: Merge pull request #17 from couchbaselabs/bug/ CBL-623

            Build couchbase-lite-java-2.8.0-26 contains couchbase-lite-java-ee commit f057054 with commit message:
            Add automated test for CBL-623

            build-team Couchbase Build Team added a comment - Build couchbase-lite-java-2.8.0-26 contains couchbase-lite-java-ee commit f057054 with commit message: Add automated test for CBL-623

            Build couchbase-lite-android-2.8.0-38 contains couchbase-lite-java-ee commit 27da84f with commit message:
            Merge pull request #17 from couchbaselabs/bug/CBL-623

            build-team Couchbase Build Team added a comment - Build couchbase-lite-android-2.8.0-38 contains couchbase-lite-java-ee commit 27da84f with commit message: Merge pull request #17 from couchbaselabs/bug/ CBL-623

            Build couchbase-lite-android-2.8.0-38 contains couchbase-lite-java-ee commit f057054 with commit message:
            Add automated test for CBL-623

            build-team Couchbase Build Team added a comment - Build couchbase-lite-android-2.8.0-38 contains couchbase-lite-java-ee commit f057054 with commit message: Add automated test for CBL-623
            blake.meike Blake Meike made changes -
            Status Resolved [ 5 ] Closed [ 6 ]
            blake.meike Blake Meike made changes -
            Link This issue relates to CBL-608 [ CBL-608 ]

            Build couchbase-lite-java-2.8.0-27 contains couchbase-lite-java commit 409d86d with commit message:
            CBL-623: Merge flags fix (#185)

            build-team Couchbase Build Team added a comment - Build couchbase-lite-java-2.8.0-27 contains couchbase-lite-java commit 409d86d with commit message: CBL-623 : Merge flags fix (#185)

            Build couchbase-lite-android-2.8.0-39 contains couchbase-lite-java commit 409d86d with commit message:
            CBL-623: Merge flags fix (#185)

            build-team Couchbase Build Team added a comment - Build couchbase-lite-android-2.8.0-39 contains couchbase-lite-java commit 409d86d with commit message: CBL-623 : Merge flags fix (#185)
            daniel.petersen Daniel Petersen made changes -
            Link This issue is cloned by CBL-634 [ CBL-634 ]
            daniel.petersen Daniel Petersen made changes -
            Resolution Fixed [ 1 ]
            Status Closed [ 6 ] Reopened [ 4 ]
            daniel.petersen Daniel Petersen made changes -
            Fix Version/s Hydrogen [ 16189 ]
            Fix Version/s Mercury [ 16188 ]
            daniel.petersen Daniel Petersen made changes -
            Resolution Fixed [ 1 ]
            Status Reopened [ 4 ] Resolved [ 5 ]
            daniel.petersen Daniel Petersen made changes -
            Status Resolved [ 5 ] Closed [ 6 ]
            daniel.petersen Daniel Petersen made changes -
            Component/s Java-AppServer [ 15345 ]

            People

              blake.meike Blake Meike
              sridevi.saragadam Sridevi Saragadam
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes

                  PagerDuty