Skip to content

VersionWarning#1086

Open
SteveMicroNova wants to merge 1 commit intomainfrom
VersionWarning
Open

VersionWarning#1086
SteveMicroNova wants to merge 1 commit intomainfrom
VersionWarning

Conversation

@SteveMicroNova
Copy link
Contributor

@SteveMicroNova SteveMicroNova commented Feb 25, 2026

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?

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

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
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 2 times, most recently from cbb7b8f to 0233d21 Compare February 25, 2026 21:24
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.

1 participant