Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable caching of index.html when in dev mode #5017

Merged
merged 2 commits into from
Jan 15, 2025

Conversation

knolleary
Copy link
Member

@knolleary knolleary commented Jan 15, 2025

When telemetry (ie sentry) is enabled, the app loads index.html and injects the necessary scripts - and then caches the result for subsequent requests.

When running in dev mode (ie npm run serve), webpack rewrites index.html with the new content hashes applied. However, the forge app still serves the cached version - causing errors.

This fix disables the caching of index.html when telemetry is enabled and we're running in development mode. We know we're dev mode as NODE_ENV is set to development by the npm scripts.

@knolleary knolleary requested review from joepavitt and cstns January 15, 2025 16:47
Copy link

codecov bot commented Jan 15, 2025

Codecov Report

Attention: Patch coverage is 0% with 1 line in your changes missing coverage. Please review.

Project coverage is 78.40%. Comparing base (9220a06) to head (99f83f9).
Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
forge/routes/ui/index.js 0.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5017   +/-   ##
=======================================
  Coverage   78.40%   78.40%           
=======================================
  Files         329      329           
  Lines       15478    15478           
  Branches     3574     3574           
=======================================
  Hits        12136    12136           
  Misses       3342     3342           
Flag Coverage Δ
backend 78.40% <0.00%> (ø)

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.

@knolleary
Copy link
Member Author

Failing UI test - looking....

@cstns
Copy link
Contributor

cstns commented Jan 15, 2025

it's the flaky offboarding test which redirects to google, re-running the tests should fix it

I'll create an issue for it

@knolleary
Copy link
Member Author

UI Test failure is unrelated I think. The failing test is that we redirect to the given URL when a user deletes.

  -'\'https://www.google.com/search?q=rick+astley&sei=2eeHZ9-zD-eg5NoPgpGlYA\''
      +'\'https://www.google.com/search?q=rick+astley\''

In this run, the additional sei= query param has been added from somewhere. Can't see anything obvious in our code - could be some cypress artefact? It is too generic a property to find any meaningful search results online about it.

Have pushed a fix to make the test accommodate additional query params.

@knolleary knolleary merged commit 5b66f52 into main Jan 15, 2025
20 checks passed
@knolleary knolleary deleted the disable-index-caching-in-dev-mode branch January 15, 2025 17:18
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