Skip to content

Fix variable_bit_size command corruption and add UI support#2777

Merged
jmthomas merged 3 commits intomainfrom
bug/variable_bit_items
Feb 6, 2026
Merged

Fix variable_bit_size command corruption and add UI support#2777
jmthomas merged 3 commits intomainfrom
bug/variable_bit_items

Conversation

@jmthomas
Copy link
Copy Markdown
Member

@jmthomas jmthomas commented Feb 3, 2026

  • Use deep_copy instead of clone when building commands to prevent shared item modifications from affecting the template packet
  • Fix Python truthiness bug in structure.py where original_array_size=0 was incorrectly treated as falsy (use is None check instead)
  • Add disabled state to LENGTH fields in Command Sender UI since they are auto-managed by variable_bit_size mechanism
  • Add VARIABLE_ARRAYS command/telemetry handling to sim_inst.rb
  • Add unit tests for structure to catch the array size truthiness bug
  • Add Playwright E2E test for VARIABLE_ARRAYS command

closes #2749

- Use deep_copy instead of clone when building commands to prevent
  shared item modifications from affecting the template packet
- Fix Python truthiness bug in structure.py where original_array_size=0
  was incorrectly treated as falsy (use `is None` check instead)
- Add disabled state to LENGTH fields in Command Sender UI since they
  are auto-managed by variable_bit_size mechanism
- Add VARIABLE_ARRAYS command/telemetry handling to sim_inst.rb
- Add unit tests for structure to catch the array size truthiness bug
- Add Playwright E2E test for VARIABLE_ARRAYS command

Co-Authored-By: Claude Opus 4.5 <[email protected]>
@codecov
Copy link
Copy Markdown

codecov bot commented Feb 3, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 78.73%. Comparing base (01ee687) to head (4241428).
⚠️ Report is 32 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2777      +/-   ##
==========================================
+ Coverage   78.70%   78.73%   +0.02%     
==========================================
  Files         671      671              
  Lines       54796    54823      +27     
  Branches      731      731              
==========================================
+ Hits        43128    43164      +36     
+ Misses      11588    11579       -9     
  Partials       80       80              
Flag Coverage Δ
python 80.36% <ø> (+0.01%) ⬆️
ruby-api 82.73% <ø> (ø)
ruby-backend 81.83% <100.00%> (+0.04%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ 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.

if item.variable_bit_size:
minimum_data_bits = 0
if (item.data_type == "INT" or item.data_type == "UINT") and not item.original_array_size:
if (item.data_type == "INT" or item.data_type == "UINT") and item.original_array_size is None:
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Another not bug where item.original_array_size could be 0

Copy link
Copy Markdown
Contributor

@mcosgriff mcosgriff Feb 3, 2026

Choose a reason for hiding this comment

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

Fun with dynamic languages!

if not item.original_array_size: - Evaluates to True for:
- None
- 0 (zero)
- Any other "falsy" value (empty string, empty list, False, etc.)

if item.original_array_size is None: - Evaluates to True ONLY for:
- None

Copy link
Copy Markdown
Contributor

@mcosgriff mcosgriff left a comment

Choose a reason for hiding this comment

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

Python looks good, thanks for the unit tests!

@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud bot commented Feb 3, 2026

Quality Gate Failed Quality Gate failed

Failed conditions
5 New issues
7.1% Duplication on New Code (required ≤ 3%)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

@jmthomas jmthomas requested a review from mcosgriff February 4, 2026 14:05
@jmthomas jmthomas merged commit 730e44c into main Feb 6, 2026
47 of 49 checks passed
@jmthomas jmthomas deleted the bug/variable_bit_items branch February 6, 2026 22:17
jmthomas added a commit that referenced this pull request Mar 21, 2026
Fix variable_bit_size command corruption and add UI support
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.

Error when parsing mutiple variablie bit sized arrays

2 participants