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

[Bug] - Having anything else than en-US first in Accepted-Language headers kill the client #1720

Closed
4 tasks done
0xAnansi opened this issue Jun 30, 2023 · 3 comments · Fixed by #1721
Closed
4 tasks done
Labels
bug Something isn't working

Comments

@0xAnansi
Copy link
Contributor

0xAnansi commented Jun 30, 2023

Requirements

  • This is a bug report, and if not, please post to https://lemmy.ml/c/lemmy_support instead.
  • Please check to see if this issue already exists.
  • It's a single bug. Do not report multiple bugs in one issue.
  • It's a frontend issue, not a backend issue; Otherwise please create an issue on the backend repo instead.

Summary

Seems that the bug returns.

Now, if you setup your browser as accepting, for example, french first so that it sends the header Accepted-Language: fr-FR,en-US;q=0.7,en;q=0.3, nothing displays in the UI.

The client does not look for the right path to resolve the reference to the local js file.

Uncaught (in promise) Error: Cannot find module './fr-FR'
    a https://jlai.lu/static/9e7fec7/js/client.js:2
    promise callback*a https://jlai.lu/static/9e7fec7/js/client.js:2
    e https://jlai.lu/static/9e7fec7/js/client.js:2
    p https://jlai.lu/static/9e7fec7/js/client.js:2
    C https://jlai.lu/static/9e7fec7/js/client.js:2
    w https://jlai.lu/static/9e7fec7/js/client.js:2
    e https://jlai.lu/static/9e7fec7/js/client.js:2
    s https://jlai.lu/static/9e7fec7/js/client.js:2
    t https://jlai.lu/static/9e7fec7/js/client.js:2
    t https://jlai.lu/static/9e7fec7/js/client.js:2
    Ki https://jlai.lu/static/9e7fec7/js/client.js:2
    Zi https://jlai.lu/static/9e7fec7/js/client.js:2
    e https://jlai.lu/static/9e7fec7/js/client.js:2
    p https://jlai.lu/static/9e7fec7/js/client.js:2
    C https://jlai.lu/static/9e7fec7/js/client.js:2
    w https://jlai.lu/static/9e7fec7/js/client.js:2
    e https://jlai.lu/static/9e7fec7/js/client.js:2
    s https://jlai.lu/static/9e7fec7/js/client.js:2
    t https://jlai.lu/static/9e7fec7/js/client.js:2
    t https://jlai.lu/static/9e7fec7/js/client.js:2
    Kf https://jlai.lu/static/9e7fec7/js/client.js:2
    <anonymous> https://jlai.lu/static/9e7fec7/js/client.js:2
    <anonymous> https://jlai.lu/static/9e7fec7/js/client.js:2
    <anonymous> https://jlai.lu/static/9e7fec7/js/client.js:2
    <anonymous> https://jlai.lu/static/9e7fec7/js/client.js:2

It should have at least a gracious fallback mechanism since this is not the first time it breaks.

Steps to Reproduce

  1. Open your browser and set its accepted language as French, for example on Firefox:
    image

Then

image
2. Load a lemmy instance
3. Look:

image

  1. If you still see content, check in your dev tools that the request is sent with the header value starting with fr-FR Accepted-Language: fr-FR,en-US;q=0.7,en;q=0.3,

Technical Details

Seems that the client looks for the translation file in the wrong directory again or the file is not named as expected.

Uncaught (in promise) Error: Cannot find module './fr-FR'
    a https://jlai.lu/static/9e7fec7/js/client.js:2
    promise callback*a https://jlai.lu/static/9e7fec7/js/client.js:2
    e https://jlai.lu/static/9e7fec7/js/client.js:2
    p https://jlai.lu/static/9e7fec7/js/client.js:2
    C https://jlai.lu/static/9e7fec7/js/client.js:2
    w https://jlai.lu/static/9e7fec7/js/client.js:2
    e https://jlai.lu/static/9e7fec7/js/client.js:2
    s https://jlai.lu/static/9e7fec7/js/client.js:2
    t https://jlai.lu/static/9e7fec7/js/client.js:2
    t https://jlai.lu/static/9e7fec7/js/client.js:2
    Ki https://jlai.lu/static/9e7fec7/js/client.js:2
    Zi https://jlai.lu/static/9e7fec7/js/client.js:2
    e https://jlai.lu/static/9e7fec7/js/client.js:2
    p https://jlai.lu/static/9e7fec7/js/client.js:2
    C https://jlai.lu/static/9e7fec7/js/client.js:2
    w https://jlai.lu/static/9e7fec7/js/client.js:2
    e https://jlai.lu/static/9e7fec7/js/client.js:2
    s https://jlai.lu/static/9e7fec7/js/client.js:2
    t https://jlai.lu/static/9e7fec7/js/client.js:2
    t https://jlai.lu/static/9e7fec7/js/client.js:2
    Kf https://jlai.lu/static/9e7fec7/js/client.js:2
    <anonymous> https://jlai.lu/static/9e7fec7/js/client.js:2
    <anonymous> https://jlai.lu/static/9e7fec7/js/client.js:2
    <anonymous> https://jlai.lu/static/9e7fec7/js/client.js:2
    <anonymous> https://jlai.lu/static/9e7fec7/js/client.js:2

Lemmy Instance Version

0.18.1-rc5

Lemmy Instance URL

https://jlai.lu

@0xAnansi 0xAnansi added the bug Something isn't working label Jun 30, 2023
@0xAnansi 0xAnansi changed the title [Bug] - Having anything else than en-US first in Accepted_language headers kill the client [Bug] - Having anything else than en-US first in Accepted-Language headers kill the client Jun 30, 2023
@sunaurus
Copy link
Collaborator

Unfortunately there is some different bug at work here, those steps are not reproducing the issue for me:

image

Overall the bug seems to only affect a limited amount of users under specific conditions, if anybody can figure out what those conditions are then that would be awesome. I am planning to investigate this further over the weekend.

@sunaurus
Copy link
Collaborator

Copying a post from a thread on lemm.ee, I have not verified if these steps can reproduce the issue for me or not:


I’ve tried to reproduce the steps aswell and it’s kinda tricky because some of the combinations that didn’t work are now just working and I don’t know why.

A way to reproduce it on my end that seems to be pretty reliable so far:

Lemmy language set to browser default and browser set to english, everything works. (I can also set browser default, english, german, doesn’t matter).
Set browser language to german while Lemmy is set to english and restart browser (I’m using chrome btw) Still everything is working.

Now switching back to browser default has it also working as long as I stay on the site. I can refresh the feed by clicking on the lemmy logo, view posts, go back via the lemmy logo etc.
But once I refresh the entire site through chrome, it stops working and I have to change the browser language to english again to set it back up. (It even showed my username at the top right as “Tankon” instead of “Taxxor” for one refresh, the next refresh had the login and sign up buttons, then it was “Taxxor” again on the next^^)

The shorter way would be to have Lemmy set to browser default while having the browser set to english end then switch the browser to german.
But I thought the scenario above where I can still use the site after setting it to browser default as long as I don’t do a full refresh might be of interest to see what the issue might be.

I have this problem on two different systems.

@RogerSik
Copy link

Same issue here. For me it's working fine on Windows with Edge. But on Android with Edge as browser it's broken like on the first comment described.

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
None yet
Development

Successfully merging a pull request may close this issue.

3 participants