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

Merged
jstarpl merged 7 commits into
masterfrom
fix/sofie-3889/stale-state-is-acted-upon
May 6, 2025
Merged

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
jstarpl merged 7 commits into
masterfrom
fix/sofie-3889/stale-state-is-acted-upon

Conversation

@jstarpl

@jstarpl jstarpl commented Apr 24, 2025

Copy link
Copy Markdown
Contributor

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 <mint@superfly.tv>
@jstarpl jstarpl requested a review from a team as a code owner April 24, 2025 10:27
@codecov-commenter

codecov-commenter commented Apr 24, 2025

Copy link
Copy Markdown

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
@nytamin nytamin deleted the fix/sofie-3889/stale-state-is-acted-upon branch June 16, 2026 05:44
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