Skip to content

VersionWarning - #1086

Merged
SteveMicroNova merged 4 commits into
mainfrom
VersionWarning
Jun 24, 2026
Merged

VersionWarning#1086
SteveMicroNova merged 4 commits into
mainfrom
VersionWarning

Conversation

@SteveMicroNova

@SteveMicroNova SteveMicroNova commented Feb 25, 2026

Copy link
Copy Markdown
Contributor

What does this change intend to accomplish?

If you have a cached version of amplipi, or keep the site open in another tab / in the app before and after an update, your code is liable to be mismatched with the backend and have odd behaviors. This warning surfaces that issue to the user so they know that they're in need of restarting their browser/app or clearing their cache.

Desktop:
image

Mobile:
image

Checklist

  • Have you tested your changes and ensured they work?
  • Have you checked to ensure there aren't other open Pull Requests for the same update/change?
  • If applicable, have you updated the CHANGELOG?
  • Does your submission pass linting & tests? You can test on localhost using ./scripts/test
  • If this is a UI change, have you tested it across multiple browser platforms on both desktop and mobile?

Comment thread web/src/App.jsx Outdated
set({ skipUpdate: false });
} else {
set({ status: s, loaded: true, disconnected: false });
if(s.info.version != "0.4.11"){

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I would like a more robust version pin than "Remember to update this line before every update"

Finding a way for react to store the poetry version would be ideal, but any way that doesn't require intentional manual upkeep is mandatory for this imo

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

#1086 (comment)
Updated this line to:

if(s.info.version != import.meta.env.VITE_BACKEND_VERSION){

@SteveMicroNova

Copy link
Copy Markdown
Contributor Author

This PR also has a lot of changes to the various StatusBar style components, that's due to me waffling about which version I should use and wanting them all to have feature parity as I found upgrades I could easily build for my immediate needs

Comment thread scripts/deploy
echo "Building web app"
pushd ../web # Change to web directory
npm install # Install nodejs dependencies
echo "VITE_BACKEND_VERSION=$(poetry version -s)" > .env # Collect the version number and bake it into the frontend

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I've learned that Vite can bake environment variables into the compiled webapp if you use a dotenv and prefix the vars with VITE_ so I dynamically grab the poetry version and put it in a .env at build time

@SteveMicroNova
SteveMicroNova marked this pull request as ready for review February 25, 2026 21:14
@SteveMicroNova
SteveMicroNova force-pushed the VersionWarning branch 3 times, most recently from 862f88e to e129535 Compare February 26, 2026 17:41
@linknum23

Copy link
Copy Markdown
Contributor

This PR also has a lot of changes to the various StatusBar style components, that's due to me waffling about which version I should use and wanting them all to have feature parity as I found upgrades I could easily build for my immediate needs

Should these be at least in a separate commit? Maybe even a separate PR?

@linknum23

Copy link
Copy Markdown
Contributor

Is there a reason the bar on desktop is left aligned?

@SteveMicroNova

SteveMicroNova commented Mar 2, 2026

Copy link
Copy Markdown
Contributor Author

This PR also has a lot of changes to the various StatusBar style components, that's due to me waffling about which version I should use and wanting them all to have feature parity as I found upgrades I could easily build for my immediate needs

Should these be at least in a separate commit? Maybe even a separate PR?

At least one batch of changes is useful and belongs in this PR, and given that those components are all slightly different takes on the same base thing* I feel like retaining feature parity without splitting that into multiple PRs could have value

(*) They're all notification things, they just have different levels of working out of the box vs granular control schemes

@linknum23

Copy link
Copy Markdown
Contributor

A standard way to do this is to stack the "upgrade" first and then to add the "feature"

@SteveMicroNova

Copy link
Copy Markdown
Contributor Author

New versions:

image image

Comment thread NEW_RELEASE.md Outdated
Comment thread CHANGELOG.md
@SteveMicroNova
SteveMicroNova force-pushed the VersionWarning branch 2 times, most recently from 688d861 to 76370ce Compare June 24, 2026 19:29

@linknum23 linknum23 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good. Just change this specific message to a warning as discussed. Thanks for pushing this through.

@SteveMicroNova

Copy link
Copy Markdown
Contributor Author

Looks good. Just change this specific message to a warning as discussed. Thanks for pushing this through.

This is the last thing to do on this PR, though due to changes made in the child PR it might be easier / cleaner to change the severity level another time if that's acceptible

Or I can cherry pick and wade through a slightly odd rebase situation, but changing that color in a different PR seems simplest

@codecov-commenter

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 50.34%. Comparing base (7499989) to head (76370ce).
⚠️ Report is 97 commits behind head on main.
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1086      +/-   ##
==========================================
- Coverage   50.67%   50.34%   -0.33%     
==========================================
  Files          40       41       +1     
  Lines        7154     7397     +243     
==========================================
+ Hits         3625     3724      +99     
- Misses       3529     3673     +144     
Flag Coverage Δ
unittests 50.34% <ø> (-0.33%) ⬇️

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

☔ View full report in Codecov by Harness.
📢 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.

@SteveMicroNova

Copy link
Copy Markdown
Contributor Author

Or I can cherry pick and wade through a slightly odd rebase situation, but changing that color in a different PR seems simplest

OR I can remember that that PR is pointed at this one, so I can merge that and then change it here while having a sensible lineage and call it good

@SteveMicroNova

Copy link
Copy Markdown
Contributor Author
image image

Now for the moment of truth, "Do we like the warning version?"

SteveMicroNova and others added 3 commits June 24, 2026 16:01
… that notifies the user when the fix is unsuccessful
When the preamp microcontroller hangs it stops ACKing and every I2C
write fails with OSError 121 (EREMOTEIO). The existing fallback only
reopens the SMBus handle, which recovers a transient bus glitch but not
a hung preamp - zone control stays dead until someone power-cycles the
unit. Escalate: when the reopened-bus retry also fails, reset the
preamps in place, re-assign I2C addresses, reopen the bus and re-flush
all cached register values so zone state (mute/source/volume) survives,
then retry the write. Rate-limited to once per 20s so a benign one-off
glitch never resets audio.

Observed live on our unit 2026-06-04 (zone control dead until manual
reboot); with this patch the same wedge self-heals in under a second.

Signed-off-by: Stamate Viorel <stamate.viorel@gmail.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@SteveMicroNova
SteveMicroNova merged commit 802fa30 into main Jun 24, 2026
3 checks passed
@SteveMicroNova
SteveMicroNova deleted the VersionWarning branch June 24, 2026 20:11
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.

4 participants