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

spike: why does the UI sometimes load text wrong when versions change #2096

Open
danoswaltCL opened this issue Nov 6, 2024 · 2 comments
Open
Labels
bug Something isn't working

Comments

@danoswaltCL
Copy link
Collaborator

Version where bug was found:
all

Describe the bug
Sometimes the UI appears to use a cached version of the frontend's en.json translation keys in the browser, which results in text in buttons and labels to appear undefined or show code. This spike is to understand why.

Expected behavior
The UI should always fetch the latest en.json file (assuming that's the issue)

@danoswaltCL danoswaltCL added the bug Something isn't working label Nov 6, 2024
@amurphy-cl amurphy-cl added this to the Program Increment PI14 milestone Nov 12, 2024
@amurphy-cl
Copy link
Collaborator

Example image

Image

Let's confirm whether we see this in all environments. This is definitely replicable in staging, and usually happens after a deployment. Usually "fixable" by a hard refresh.

Pinging @kcalvo-cli are you aware of any non-caching of front end assets for some envs?

@amurphy-cl amurphy-cl moved this to Refined ToDo in UpGrade Project Nov 12, 2024
@VivekFitkariwala
Copy link
Collaborator

This might be because we are using the same HTTP request to query en.json

We can add query params to disable the cache

export function HttpLoaderFactory(http: HttpClient, environment: Environment) {
  return new TranslateHttpLoader(http, `${environment.baseHrefPrefix}/assets/i18n/`, `.json?time=${new Date().getTime()}`);
}

In the above code, I have added the current time, which means it will be queried every time. A better way would be to use a version tag of the build.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Refined ToDo
Development

No branches or pull requests

3 participants