Unable to retrieve binary documents with TransactionAttemptContext

Description

Description

Fetching binary/plaintext documents via a TransactionAttemptContext seems to fail, and exits without any information. `ctx.get()` for a normal JSON document works, as does fetching the binary doc with `collection.get()`. 

This was discovered when implementing transactions on Ottoman, as we use binary docs for our refdoc implementation. The offending lines are here: https://github.com/couchbaselabs/node-ottoman/pull/758/files#diff-dbfff5681984fd751309a6ef8fbc810eeba678c07dc87f873ff9fec7f18158caR38-R46

 

Actual Behavior

Using `ctx.get()` with a binary document's ID doesn't return the document, and exits without additional info.

 

Expected Behavior

Using `ctx.get()` with a binary document's ID should return the document the same way it does for JSON documents.

 

Evidence

The attached `index.js` file attempts to get three documents (a JSON doc via ctx, a binary doc via collection, and a binary doc via ctx), the first two of which work fine, but it never gets past the last one.

 

Steps to Reproduce

  1. Create binary and JSON documents in `travel-sample._default.users` collection (or adjust the bucket/scope/collection in index.js) and run index.js

  2. Observe first two console.log() statements show documents retrieved, but we never make it to the third

Environment

MacOS 13.2.1, Couchbase Server Enterprise Edition 7.2.4 build 7070 running in Docker

Gerrit Reviews

None

Release Notes Description

None

Attachments

2

Activity

Show:

Jared Casey April 9, 2024 at 9:39 PM

Hi – I have a change coming to the SDK that will prevent the silent crash in this scenario. However, I need to stress that currently the SDKs do no support binary documents w/ transactions. By design, the transactions spec assumes JSON data. So, while the SDK will no longer crash in this scenario, I doubt you will get the behavior ottoman.js is looking for when using transactions if using binary documents.

Some good news though: w/in the last couple of weeks an update for the transactions spec to support binary data has been added. The problem will come down to priorities as we first need to implement changes w/in the C++ core and then we can implement binary support w/in the wrapper SDKs. If possible, I would recommend a CBSE as that will help PM w/ priorities (can link this JSCBC).

Please let me know if you have any questions.

Fixed
Pinned fields
Click on the next to a field label to start pinning.

Details

Assignee

Reporter

Story Points

Fix versions

Affects versions

Priority

Instabug

Open Instabug

PagerDuty

Sentry

Zendesk Support

Created March 8, 2024 at 8:11 PM
Updated October 28, 2024 at 11:03 PM
Resolved April 15, 2024 at 5:04 PM
Instabug