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

revpos under _attachments should not increase while no touch during doc update

    XMLWordPrintable

Details

    • Bug
    • Resolution: Won't Fix
    • Major
    • 3.1.0
    • 3.0
    • LiteCore
    • Security Level: Public
    • None
    • Pasin 66, Pasin 67, Pasin 68
    • 3

    Description

      After a couple of discussion, here are the key steps of the problem:

      1. on CBL, create a doc contains only a string type of key/value, push to SG
      2. on CBL, get this doc by id, update the doc by adding another string type of key/value, push to SG, then it looks like this:
      3. on CBL get this doc by id, update the doc by adding a Blob, push to SG, then it looks like this:

      {
          "_attachments": {
              "blob_/blob1": {
                  "content_type": "text/plain",
                  "digest": "sha1-uYBbYBb5WP9aN28rlkmsA5PQg7k=",
                  "length": 12,
                  "revpos": 3,
                  "stub": true
              }
          },
          "_id": "blob-test-1",
          "_rev": "3-xxx",
          "blob1": {
              "@type": "blob",
              "content_type": "text/plain",
              "digest": "sha1-uYBbYBb5WP9aN28rlkmsA5PQg7k=",
              "length": 12
          },
          "k1": "string value 1",
          "k2": "string value 2"
      }
      

      4. on CBL get this doc by id, update the doc by adding a string value, no touch to the blob, push to SG, then it looks like this:

      {
          "_attachments": {
              "blob_/blob1": {
                  "content_type": "text/plain",
                  "digest": "sha1-uYBbYBb5WP9aN28rlkmsA5PQg7k=",
                  "length": 12,
                  "revpos": 4,
                  "stub": true
              }
          },
          "_id": "blob-test-1",
          "_rev": "4-xxx",
          "blob1": {
              "@type": "blob",
              "content_type": "text/plain",
              "digest": "sha1-uYBbYBb5WP9aN28rlkmsA5PQg7k=",
              "length": 12
          },
          "k1": "string value 1",
          "k2": "string value 2"
          "newk1": "string added after blob"
      }
      

      Expect:

      "revpos": 3 in "_attachments" because the blob is not updated at step 4.

      Actual:
      "revpos": 4 in "_attachments" revpos got increased even though there is no touch on the blob during the doc update

      Attachments

        Issue Links

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

          Activity

            People

              pasin Pasin Suriyentrakorn
              eunice.huang Eunice Huang (Inactive)
              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