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

Fail to decode empty response to a Read operation #1622

Open
dnav opened this issue Jun 11, 2024 · 4 comments · Fixed by #1624
Open

Fail to decode empty response to a Read operation #1622

dnav opened this issue Jun 11, 2024 · 4 comments · Fixed by #1624
Labels
core Impact core of Leshan spec ambiguity Issue because of specification/RFC ambiguity

Comments

@dnav
Copy link

dnav commented Jun 11, 2024

Version(s)

2.0.0-SNAPSHOT (leshan.eclipseprojects.io)

Which components

leshan.eclipseprojects.io

Tested With

custom CoAP server

What happened

When performing a Read operation returning an empty response, Leshan returns an "failed to decode" error in some case.

I tested a Read on an empty Object (no Object Instance), an empty Object Instance (no readable Resource, object ID 7), and an empty multiple Resource (no Resource Instance).

The response is always a 2.05 content with or witout a content-format option, and with or without a payload.

Content-format option payload Read on Object Read on Object Instance Read on Resource Instance
none none Error: "Invalid Response: Unable to decode response payload" Error: "Invalid Response: Unable to decode response payload" Error: "Invalid Response: Unable to decode response payload"
SenML CBOR none Success Error: "Invalid Response: Unable to decode response payload" Success
SenML CBOR 0x80 (array of 0 elements) Success Error: "Invalid Response: Unable to decode response payload" Success
SenML JSON none Success Error: "Invalid Response: Unable to decode response payload" Success
SenML JSON "[]" Success Error: "Invalid Response: Unable to decode response payload" Success
TLV none Success Success Success
TLV 0x08 00 00 (empty instance 0) Success Success Success

How to reproduce

No response

Relevant Output

No response

@sbernard31
Copy link
Contributor

Thx for reporting 🙏.

For none content format line, this is the expected behavior for now. We will wait for OMA answer to OpenMobileAlliance/OMA_LwM2M_for_Developers#579 before to change anything.

For Read on Object Instance, I need to investigate as at first sight there is a kind on inconsistency.

@sbernard31
Copy link
Contributor

The Object Instance inconsistent behavior is fixed by #1624.

I let this issue open waiting for the none content format case answer.

@sbernard31 sbernard31 added the core Impact core of Leshan label Jun 14, 2024
@sbernard31
Copy link
Contributor

I integrated #1624 in master. It will be available in sandbox very soon and will be part of next release 2.0.0-M15.

Issue was closed automatically I reopen it because :

I let this issue open waiting for the none content format case answer.

@sbernard31 sbernard31 reopened this Jun 17, 2024
@sbernard31 sbernard31 added spec ambiguity Issue because of specification/RFC ambiguity and removed bug Dysfunctionnal behavior spec ambiguity Issue because of specification/RFC ambiguity labels Jun 17, 2024
@slaft
Copy link

slaft commented Jul 26, 2024

While looking into #1633, I also checked what happens when an empty payload is sent in a Read Response/Observe Response/Notify.

This is what I came across (with Leshan 2.0.0-M15):

  • On Object, Object Instance or multiple Resource:
    • JSON -> InvalidResponseException
    • SenML JSON -> success
    • SenML CBOR -> success
  • On single Resource or multiple Resource Instance:
    • JSON -> InvalidResponseException
    • SenML JSON -> InvalidResponseException
    • SenML CBOR -> InvalidResponseException
  • On a Composite request:
    • SenML JSON -> success
    • SenML CBOR -> success

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Impact core of Leshan spec ambiguity Issue because of specification/RFC ambiguity
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants