Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with building keypath in C API #7805

Closed
papafe opened this issue Jun 12, 2024 · 2 comments · Fixed by #7986
Closed

Issue with building keypath in C API #7805

papafe opened this issue Jun 12, 2024 · 2 comments · Fixed by #7986
Assignees

Comments

@papafe
Copy link
Contributor

papafe commented Jun 12, 2024

Considering the method build_key_path_array, it seems it does not allow to create an empty KeyPathArray:

std::optional<KeyPathArray> build_key_path_array(realm_key_path_array_t* key_path_array)
{
std::optional<KeyPathArray> ret;
if (key_path_array && key_path_array->size()) {
ret.emplace(std::move(*key_path_array));
}
return ret;
}

The method returns std::nullopt in two scenarios:

  1. When key_path_array is nullptr.
  2. When key_path_array points to an array with a length of zero.

But in case 2 it should return an empty KeyPathArray.

Copy link

sync-by-unito bot commented Jun 12, 2024

➤ PM Bot commented:

Jira ticket: RCORE-2167

@kiburtse
Copy link
Contributor

kiburtse commented Jul 9, 2024

ok, so It's already so in c++ api, but it looks like there was some back and forth with it in #6122 and then #7087. @jedelbo @nicola-cab was it just an oversight due to missing test cases?

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 14, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants