Skip to content

Erroneous options validation in viewQuery (skip) #254

Description

@sitzz

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions