couchbase / couchbase/couchbase-php-client
Erroneous options validation in viewQuery (skip)
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 7
- Forks
- 13
- Avg merge
- 6d 10m
- Merged PRs (30d)
- 2
Description
When using viewQuery, adding a skip value in ViewOptions, an error is raised:
'invalid_argument (3): "expected skip to be a boolean value in the options"'
When looking for the cause, found this:
connection_handle.cxx#2772
if (auto e = cb_assign_boolean(request.skip, options, "skip"); e.ec) {
return e;
}
While all methods and documentation clearly indicates that the expected type of the value for ViewOptions->skip must be integer, here it's validated as a boolean. It should rightfully be as follows:
if (auto e = cb_assign_integer(request.skip, options, "skip"); e.ec) {
return e;
}
This solution has been implemented and built locally and confirmed working as expected.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at src/wrapper/connection_handle.cxx around line 2772 and inspect the viewQuery option handling alongside the ViewOptions documentation and related methods. Verify that a numeric skip value is accepted, the boolean error is gone, and the project still builds with the relevant tests passing.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp, php
- Domain
- databases
- Issue type
- Bug
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 75/100