couchbase / couchbase/couchnode

New transaction `getMulti.exists()`should not throw

Open
#131 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
462
Forks
225
PR merge metrics
No merged PRs in 30d

Description

The whole purpose of getMulti.exists() is to check the existence of an element, so it should not throw if the element does not exist, out of bounds or not. This is especially annoying in the case of a dynamic number of documents.

The contentAt method is legit to throw, even though returning undefined is a perfectly valid option (because it's an illegal json value) but there is the case for binary content that could be decoded as undefined

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing the transaction getMulti.exists() entry point and compare its behavior with contentAt. Reproduce missing and out-of-bounds lookups, then verify that existence checks complete without throwing while contentAt retains its documented behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
node.js, typescript
Domain
api, databases
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.