Skip to content

Conversation

@mkuratczyk
Copy link
Contributor

What

Users should no longer run into issues with the Management UI when upgrading RabbitMQ. There are numerous reports
of JavaScript errors, blank pages, or just header+footer pages (without the main content).

How?

  1. When build RMQ, a version is injected into index.html
  2. index.html refers to all our JS and CSS files with query string v=$VERSION and therefore the URL changes from version to version
  3. If Management UI is disconnected from the server (red error at the top) and then reconnects, it'll trigger a full reload (likely we are now connected to a different node and/or different server version)
  4. If the Management UI is open on the main page, it checks the management_version returned by the /api/overview endpoint and compares it with its own version (defined in index.html). If there's a difference - a full page reload is performed (this is clearly an upgrade)

Breaking change: we no longer support MSIE 8 :) (evil.css was a piece of history: https://github.com/rabbitmq/rabbitmq-server/commits/v4.0.x/deps/rabbitmq_management/priv/www/css/evil.css)

@michaelklishin michaelklishin changed the title Management reload Make sure Management UI JavaScript files are forced to reload after an upgrade Nov 7, 2024
@michaelklishin
Copy link
Collaborator

Sweet! It kind of sucks that we still do not have the new alpha builds infra for PRs but as soon as we sanity check it and merge, we will have a complete set of packages to try.

@mkuratczyk mkuratczyk marked this pull request as ready for review November 12, 2024 10:24
@michaelklishin michaelklishin added this to the 4.1.0 milestone Nov 13, 2024
Copy link
Collaborator

@michaelklishin michaelklishin left a comment

Choose a reason for hiding this comment

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

This is a widely used approach and given our "minimalistic" (read: simplistic) UI code, this seems like the best approach.

Works as expected, including the full reload when the API reports a different version.

@michaelklishin
Copy link
Collaborator

Not sure why Selenium suites begin to flake again but given the scope of the change, I assume that if some of them pass, then all of them should and these are, indeed, flakes.

@mkuratczyk mkuratczyk marked this pull request as draft November 14, 2024 10:07
mkuratczyk and others added 5 commits November 14, 2024 11:45
To avoid using a chached version from an older RabbitMQ version.
1. If the Management UI lost connection and established it again,
there's a good chance it's now connected to a diffrent RabbitMQ
node, potentially running a different version.

2. If the overview endpoints returns a different version, fully reload
   the page. This only works on the home page, but that's better
   than nothing
Users often report JavaScript or page display errors
after an upgrade (blank page, only header and footer, etc).
This change adds a query parameter for JS/CSS files, so that
they change from version to version and therefore are the browser
should not use the outdated cache entries.
@mkuratczyk
Copy link
Contributor Author

The OAuth2 issue looks legitimate - seems to be a race condition based on whether prefs.js is fetched before bootstrap.js is executed

@mkuratczyk mkuratczyk force-pushed the management-reload branch 2 times, most recently from 18c684c to e0f3f76 Compare November 14, 2024 11:47
@michaelklishin michaelklishin self-requested a review November 14, 2024 17:16
@mkuratczyk
Copy link
Contributor Author

Closing in favour of #12749

@mkuratczyk mkuratczyk closed this Nov 18, 2024
@michaelklishin michaelklishin deleted the management-reload branch November 18, 2024 17:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants