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

Treat normalized payload validation errors as warnings #5752

Merged
merged 4 commits into from Sep 1, 2022

Conversation

johanstokking
Copy link
Member

@johanstokking johanstokking commented Aug 31, 2022

Summary

Follow up on #5730
References #5429
References TheThingsNetwork/lorawan-devices#395

cc @pablojimpas

Changes

This changes the way field validation errors are treated. Before, the error was propagated to the caller and the entire payload wouldn't be considered normalized. This means that one out-of-bounds field renders the entire payload invalid. I think this isn't a nice developer experience: we should still not set these fields to out-of-bounds values but we should accept the rest of the fields and set the errors as warnings.

There's also a small unrelated change to see the normalized_payload{_warnings} in the payload simulation view.

Testing

CI and simulated uplink:
Screen Shot 2022-08-31 at 17 59 13

Regressions

None expected

Notes for Reviewers

  • No need for changelog entry because this is still unreleased
  • @kschiffer only review code owned files. I didn't add a code editor for the normalized payload. I think that would be nice though (although it's in the complete payload too), but just putting another editor in there didn't feel right UX wise so I'll leave this up to you. I consider this out of scope for this PR though

Checklist

  • Scope: The referenced issue is addressed, there are no unrelated changes.
  • Compatibility: The changes are backwards compatible with existing API, storage, configuration and CLI, according to the compatibility commitments in README.md for the chosen target branch.
  • Documentation: Relevant documentation is added or updated.
  • Changelog: Significant features, behavior changes, deprecations and fixes are added to CHANGELOG.md.
  • Commits: Commit messages follow guidelines in CONTRIBUTING.md, there are no fixup commits left.

@johanstokking johanstokking added this to the v3.21.2 milestone Aug 31, 2022
@johanstokking johanstokking self-assigned this Aug 31, 2022
@github-actions github-actions bot added c/application server This is related to the Application Server ui/web This is related to a web interface labels Aug 31, 2022
Copy link
Member

@kschiffer kschiffer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes look good. I wouldn't want to add something ad-hoc in here, so if you could create an issue for showing the normalized payload that would be great.

@johanstokking johanstokking merged commit 4f42b75 into v3.21 Sep 1, 2022
@johanstokking johanstokking deleted the feature/normalized-payload-warnings branch September 1, 2022 13:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c/application server This is related to the Application Server ui/web This is related to a web interface
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants