MEN-9997: Fix inconsistencies in deviceauth status handlers - #2138
Open
alfrunes wants to merge 13 commits into
Open
MEN-9997: Fix inconsistencies in deviceauth status handlers#2138alfrunes wants to merge 13 commits into
alfrunes wants to merge 13 commits into
Conversation
Signed-off-by: Alf-Rune Siqveland <alf.rune@northern.tech>
Test was passing due to flawed error handling. Signed-off-by: Alf-Rune Siqveland <alf.rune@northern.tech>
Contributor
|
Merging these commits will result in the following changelog entries: Changelogsmender-server (MEN-9997)New changes in mender-server since main: Features
|
alfrunes
force-pushed
the
MEN-9997
branch
3 times, most recently
from
August 5, 2026 08:50
a0be37a to
6f1e1a6
Compare
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
alfrunes
force-pushed
the
MEN-9997
branch
2 times, most recently
from
August 5, 2026 11:46
e110c6d to
b4f649a
Compare
Most caller contexts already fetched the device. Changed signature to accept device instead of deviceID and "currentStatus". Signed-off-by: Alf-Rune Siqveland <alf.rune@northern.tech>
Refactoring made more use of the mocked data which caused several tests to fail due to lack of data in the return arguments. Signed-off-by: Alf-Rune Siqveland <alf.rune@northern.tech>
Signed-off-by: Alf-Rune Siqveland <alf.rune@northern.tech>
…atus Lower cyclomatic complexity and improve readability. Signed-off-by: Alf-Rune Siqveland <alf.rune@northern.tech>
Only update the device status and trigger the event if device has the correct revision (entity tag) in the database. Ticket: MEN-9997 Signed-off-by: Alf-Rune Siqveland <alf.rune@northern.tech>
alfrunes
force-pushed
the
MEN-9997
branch
3 times, most recently
from
August 6, 2026 12:28
3df2f0b to
074e40c
Compare
Only decommission events does not carry auth sets. Changelog: Commit Signed-off-by: Alf-Rune Siqveland <alf.rune@northern.tech>
Updated provision device to use status endpoint instead of POST /devices API since the former uses the revision to protect concurrent updates. Removed the duplicate code paths for updating device statuses. Signed-off-by: Alf-Rune Siqveland <alf.rune@northern.tech>
Signed-off-by: Alf-Rune Siqveland <alf.rune@northern.tech>
Signed-off-by: Alf-Rune Siqveland <alf.rune@northern.tech>
The test would bail out early due to the mock always returning the same status. Signed-off-by: Alf-Rune Siqveland <alf.rune@northern.tech>
Signed-off-by: Alf-Rune Siqveland <alf.rune@northern.tech>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes inconsistencies and removes duplicated lookups and adds race protection for status updates.
It also expands the webhook context for status update events.
Implementation note:
provision_deviceworkflow to avoid breaking changes / creating a new workflow.Please follow the commits while reviewing as they also provide more context.