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 status code for lwm2m clients in api #9480

Merged
merged 5 commits into from Dec 12, 2022

Conversation

olcai
Copy link
Contributor

@olcai olcai commented Dec 5, 2022

Doing a HTTP POST to /gateway/lwm2m/clients/{clientid}/read returned 200 without a response body. This PR changes this so that read, write and observe all return 204 - No Content since they all share the same semantics.

Fixes EMQX-7983.

PR Checklist

Please convert it to a draft if any of the following conditions are not met. Reviewers may skip over until all the items are checked:

  • Added tests for the changes
  • Changed lines covered in coverage report
  • Change log has been added to changes/ dir
  • For internal contributor: there is a jira ticket to track this change

Backward Compatibility

More information

@coveralls
Copy link
Collaborator

coveralls commented Dec 5, 2022

Pull Request Test Coverage Report for Build 3656238166

  • 1 of 1 (100.0%) changed or added relevant line in 1 file are covered.
  • 30 unchanged lines in 14 files lost coverage.
  • Overall coverage increased (+0.09%) to 79.333%

Files with Coverage Reduction New Missed Lines %
apps/emqx_dashboard/src/emqx_dashboard_monitor.erl 1 69.44%
apps/emqx_management/src/emqx_mgmt_util.erl 1 13.79%
apps/emqx_resource/src/emqx_resource_worker.erl 1 78.72%
apps/emqx/src/emqx_channel.erl 1 87.08%
apps/emqx/src/emqx_config.erl 1 84.36%
apps/emqx/src/emqx_listeners.erl 1 86.12%
apps/emqx/src/emqx_os_mon.erl 1 82.61%
apps/emqx/src/emqx_stats.erl 1 91.67%
apps/emqx/src/emqx_alarm.erl 2 91.82%
apps/emqx/src/emqx_config_handler.erl 2 96.21%
Totals Coverage Status
Change from base Build 3649941839: 0.09%
Covered Lines: 22160
Relevant Lines: 27933

💛 - Coveralls

@olcai olcai force-pushed the fix-status-code-for-lwm2m-clients-in-api branch from 665787c to a101ac8 Compare December 6, 2022 08:00
@olcai olcai marked this pull request as ready for review December 6, 2022 08:01
changes/v5.0.12-zh.md Outdated Show resolved Hide resolved
thalesmg
thalesmg previously approved these changes Dec 6, 2022
@olcai olcai force-pushed the fix-status-code-for-lwm2m-clients-in-api branch 2 times, most recently from c521910 to dfe1cbf Compare December 7, 2022 10:44
thalesmg
thalesmg previously approved these changes Dec 8, 2022
sstrigler
sstrigler previously approved these changes Dec 8, 2022
@olcai olcai dismissed stale reviews from sstrigler and thalesmg via 2b67a07 December 9, 2022 09:42
@olcai olcai force-pushed the fix-status-code-for-lwm2m-clients-in-api branch from dfe1cbf to 2b67a07 Compare December 9, 2022 09:42
sstrigler
sstrigler previously approved these changes Dec 9, 2022
@olcai olcai force-pushed the fix-status-code-for-lwm2m-clients-in-api branch 2 times, most recently from 55330e3 to eb3e1ad Compare December 9, 2022 13:38
Change the return for lwm2m client API posts from 200 to 204 since
they contain no content.
Add test coverage for HTTP 204 returns from lwm2m client API
posts. This includes a small refactoring of the request functionality
in emqx_mgmt_api_test_util.
@olcai olcai force-pushed the fix-status-code-for-lwm2m-clients-in-api branch from eb3e1ad to 272337c Compare December 12, 2022 12:30
@olcai olcai merged commit 3a31088 into emqx:release-50 Dec 12, 2022
@olcai olcai deleted the fix-status-code-for-lwm2m-clients-in-api branch December 12, 2022 13:20
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.

None yet

5 participants