-
Notifications
You must be signed in to change notification settings - Fork 0
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
get_property: early return when property not found #2
Conversation
Signed-off-by: Eguzki Astiz Lezaun <eastizle@redhat.com>
"[vm->host] proxy_get_property(path_data, path_size) -> NotFound, status: {:?}", | ||
get_status() | ||
); | ||
assert_ne!(get_status(), ExpectStatus::Failed); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
get_expect_get_property(path_raw)
is setting status, so it must be asserted before returning.
👍 Nice. Sort of unrelated, but I'm thinking the SDK is wrong in not differentiating between a |
I wonder what the meaning of |
tested in Kuadrant/wasm-shim#39 |
Signed-off-by: Eguzki Astiz Lezaun <eastizle@redhat.com>
Signed-off-by: Eguzki Astiz Lezaun <eastizle@redhat.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While String
& Numbers
are send as is, the byte[] is pretty much expected to be protobuf, so that there is no null
and None
as such is "there is no such property known"
That's my current understanding at least
When property is not found, the testing framework was returning
Status::Ok
with empty array.Proxy-wasm-sdk library is reading that as correct return value and returning
Ok(Some(Bytes))
. The correct branch should beStatus::NotFound => Ok(None),
when the property is not found. So, fixing the return value from the testing framework.Here https://github.com/proxy-wasm/proxy-wasm-rust-sdk/blob/v0.2.1/src/hostcalls.rs#L396-L422