sync_gateway icon indicating copy to clipboard operation
sync_gateway copied to clipboard

CBG-3913 replace parseStreamWithXattr with sg-bucket function

Open torcolvin opened this issue 1 year ago • 1 comments

Depends on https://github.com/couchbase/sg-bucket/pull/122 and https://github.com/couchbase/sg-bucket/pull/123

  • Consolidate tests into a table driven test, these tests exist in sg-bucket too with just DecodeValueWithXattrs.
  • Replace errors with sgbucket errors and use errors.Is

Pre-review checklist

  • [x] Removed debug logging (fmt.Print, log.Print, ...)
  • [x] Logging sensitive data? Make sure it's tagged (e.g. base.UD(docID), base.MD(dbName))
  • [x] Updated relevant information in the API specifications (such as endpoint descriptions, schemas, ...) in docs/api

Dependencies (if applicable)

  • [x] Link upstream PRs
  • [ ] Update Go module dependencies when merged

Integration Tests

  • [x] GSI=true,xattrs=true https://jenkins.sgwdev.com/job/SyncGateway-Integration/2406/

torcolvin avatar May 08 '24 14:05 torcolvin

I was thinking about changing sgbucket.DecodeValueWithXattrs to return map[string][]byte for xattr values so the caller doesn't have to loop over them again.

torcolvin avatar May 09 '24 12:05 torcolvin