Uploaded image for project: 'Couchbase Gateway'
  1. Couchbase Gateway
  2. CBG-3878

[3.1.6 Backport] UnmarshalDocumentSyncDataFromFeed doesn't return any present user xattrs if sync data doesn't exist on the doc

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Major
    • 3.1.6
    • None
    • SyncGateway
    • Security Level: Public
    • None
    • CBG Sprint 149
    • 1

    Description

      UnmarshalDocumentSyncDataFromFeed doesn't seem to return any user xattrs defined on a doc if the doc doesn't have any sync xattr defined.

      Repro steps:

      1. Have a db setup with a sync function assigning a channel defined in your defined user xattr on the database
      2. Add doc through SDK with user xattr defined
      3. Wait for import feed to pick up the doc

      Example sync function to use:

      function(doc, oldDoc, meta) {
          if (meta.xattrs.channels === undefined) {
              console.log("no user_xattr_key defined");
              throw ({
                  forbidden: "Missing required property - metadata channel info"
              });
          } else {
              console.log(meta.xattrs.channels);
              channel(meta.xattrs.channels);
          }
      } 

      Attachments

        Activity

          People

            ben.brooks Ben Brooks
            adamf Adam Fraser
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              PagerDuty