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

fix(coap-server): correctly expose additional mediatypes #1026

Merged
merged 1 commit into from
Jun 26, 2023

Conversation

JKRhb
Copy link
Member

@JKRhb JKRhb commented Jun 17, 2023

As pointed out by @egekorkan on Discord, the testthing example currently does not expose forms with CBOR contentTypes when using a CoAP server. Trying to debug the problem, I noticed that this is caused by the helper functions updatePropertyFormWithTemplate, updateActionFormWithTemplate, and updateEventFormWithTemplate.

After reading through their source code, I am not actually sure what these functions are supposed to do, therefore I simply removed their invocation from the CoAP server for the time being which fixed the problem. If they are necessary to integrate into a server implementation, maybe you could help me out with using them correctly instead, though. Thanks :)

@codecov-commenter
Copy link

codecov-commenter commented Jun 17, 2023

Codecov Report

Merging #1026 (0b0c566) into master (96a7fa4) will decrease coverage by 0.18%.
The diff coverage is n/a.

❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more.

@@            Coverage Diff             @@
##           master    #1026      +/-   ##
==========================================
- Coverage   75.79%   75.62%   -0.18%     
==========================================
  Files          72       72              
  Lines       14871    14867       -4     
  Branches     1428     1427       -1     
==========================================
- Hits        11272    11243      -29     
- Misses       3566     3591      +25     
  Partials       33       33              
Impacted Files Coverage Δ
packages/binding-coap/src/coap-server.ts 73.02% <ø> (-0.15%) ⬇️

... and 1 file with indirect coverage changes

@relu91
Copy link
Member

relu91 commented Jun 17, 2023

If I recall correctly those set of methods are meant to update the form generated by the binding, trying to fulfill what the user set in the PartialTD passed in the produce method. My guess, is that using them in two different bindings causes some possible collisions 🤔 . However, the methods are poorly implemented and I think we should review them in the future. I propose merging this PR and keeping track of this issue.

@relu91
Copy link
Member

relu91 commented Jun 26, 2023

I talked with @danielpeintner he is ok with merging PRs if we get two approvals while he is away. Since this PR is coming from @JKRhb a soon-to-be committer, I'm merging it for the reasons mentioned in the comment above.

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