Skip to content

Conversation

DemetrisChr
Copy link
Contributor

Bring in changes from couchbase/couchbase-cxx-client#452 and make any necessary wrapper-side changes.

When calling #content for an exists spec the result is the same as the result of #exists, provided that the subdoc operation was successful or the error was path-not-found (otherwise an error is raised), which is required to be compliant with the RFC. Previously, a PathNotFound error was raised when the path did not exist. This logic is handled by the C++ core

@DemetrisChr DemetrisChr requested a review from avsej September 18, 2023 17:14
@cb-sdk-robot
Copy link
Collaborator

Can one of the admins verify this patch?

rb_hash_aset(entry, value_property, cb_str_new(resp_entry.value));
}
if (resp_entry.ec && resp_entry.ec != couchbase::errc::key_value::path_not_found) {
if (resp_entry.ec) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no need for this check now that C++ clears path_not_found status codes for exists specs

return false unless field

raise field.error unless field.error.nil?
raise field.error unless field.error.nil? || field.error.is_a?(Error::PathNotFound)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The core can return path_not_found status codes if those are coming from get or count operations. Those should not be raised if #exists is called - they should only be raised for #content

@DemetrisChr DemetrisChr merged commit 9e06b9d into couchbase:main Sep 18, 2023
@DemetrisChr DemetrisChr deleted the RCBC-450-lookup-in-exists-value branch September 18, 2023 19:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants