Skip to content

fix: if a state older than the currentState is put into handleState, a B-A-B sequence of state changes can happen (SOFIE-3889) #378

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

Merged
merged 7 commits into from
May 6, 2025

Conversation

jstarpl
Copy link
Contributor

@jstarpl jstarpl commented Apr 24, 2025

About the Contributor

This pull request is posted on behalf of the NRK.

Type of Contribution

This is a:

Bug fix

Current Behavior

In some cases, states will go into the StateHandler out of order, with state.time less than the currentState.time. This will cause additional commands to be issued and the state of the device going B-A-B, where B is the expected target state, and A is a previous, older state.

New Behavior

States older than currentState will be ignored.

Testing Instructions

  • See if the B-A-B pattern can be reproduced. If not, then this is tested successfully.

Other Information

This attempts to fix the same issue as #374

Status

  • PR is ready to be reviewed.
  • The functionality has been tested by the author.
  • Relevant unit tests has been added / updated.
  • Relevant documentation (code comments, system documentation) has been added / updated.

jstarpl and others added 2 commits April 24, 2025 11:45
…e`, a B-A-B sequence of state changes can happen

Co-authored-by: Mint de Wit <[email protected]>
@jstarpl jstarpl requested a review from a team as a code owner April 24, 2025 10:27
@codecov-commenter
Copy link

codecov-commenter commented Apr 24, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 51.77%. Comparing base (b96c410) to head (f12b53e).

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #378      +/-   ##
==========================================
+ Coverage   51.75%   51.77%   +0.01%     
==========================================
  Files         127      127              
  Lines       10204    10208       +4     
  Branches     2537     2550      +13     
==========================================
+ Hits         5281     5285       +4     
  Misses       4497     4497              
  Partials      426      426              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@jstarpl jstarpl marked this pull request as draft April 24, 2025 11:24
@jstarpl jstarpl marked this pull request as ready for review April 24, 2025 11:37
@jstarpl jstarpl merged commit 8ba5b8a into master May 6, 2025
44 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants