Closed dessalines closed 1 day ago
Ahhh I can't even replicate it now, but I've seen two people besides myself see this toast. I can't find where its coming from in the code also, besides some possible toasts where its calling JSON.stringify(res.error.message)
Even stranger, according to the git blame, the toastify dependency hasn't been updated in 22 months. 😕
I added a few places that now report error messages that previously didn't. Looks like i18n returns an empty string for unknown keys, which then makes toastify feel awesome. This makes toastify show the key instead:
--- a/src/shared/services/I18NextService.ts
+++ b/src/shared/services/I18NextService.ts
@@ -187,7 +187,7 @@ export class I18NextService {
nonExplicitSupportedLngs: true,
load: "all",
// initImmediate: false,
- fallbackLng: "en",
+ fallbackLng: ["en", "code"],
resources: { en } as Resource,
interpolation: { format },
partialBundledLanguages: true,
Edit: Irrelevant now, but "code" should have been "cimode"
Looks like i18n returns an empty string for unknown keys, which then makes toastify feel awesome.
Is this happening in English, or only non-English languages? en.json
always gets updated first since it's the language the maintainers are all fluent in, however translations for other languages can lag behind, especially ones that aren't used by much of the userbase.
Is this happening in English, or only non-English languages?
Now I always get the key for unknown keys, even without the change from above. When it did happen it was with "Browser Default" and en-US.
Odd. @dessalines have any other users encountered this issue?
Myself and davel have seen it. I'm fairly sure it's not in a place with an explicit key named, but one of the ones stringifying an error message.
Has anyone encountered this consistently? I encountered this bug once in the wild, but was unable to replicate it.
Same, haven't been able to either. I think I've just gotta close until we can actually replicate it.
I just got it too
It happened after I tried submitting a post. It didn't post, this popped up, and then I clicked a second time (after screenshotting) and it then posted correctly.
@matc-pub
Do you know how to consistently get the unknown key error like you did in your last 2 comments? I tried adding an extra non-existent fallback language like this comment, but I can't reproduce it.
Bumping back to 0.20.0 , since we can't repro.
This seems to be fairly consistent on pawb.social and I've not been able to identify why it occurs. All I can ascertain is that Lemmy closes the connection and causes a 502 error in Nginx, which then gives an HTML response that it's not expecting, and so "Toastify is awesome"
Log from Nginx
2024/10/29 17:11:25 [error] 34#34: *2972 upstream prematurely closed connection while reading response header from upstream, client: [removed], server: localhost, request: "POST /api/v3/comment HTTP/1.1", upstream: "http://[removed]:8536/api/v3/comment", host: "pawb.social", referrer: "https://pawb.social/post/15502880"
[removed] - - [29/Oct/2024:17:11:25 +0000] "POST /api/v3/comment HTTP/1.1" 502 150 "https://pawb.social/post/15502880" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/18.0.1 Safari/605.1.15"
I did find this in the logs around the same time as my second attempt:
Log from Nginx
[removed] - - [29/Oct/2024:17:16:02 +0000] "POST /api/v3/comment HTTP/1.1" 502 150 "https://pawb.social/post/15502880" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/18.0.1 Safari/605.1.15"
Log from Lemmy
thread 'actix-server worker 0' panicked at /lemmy/crates/utils/src/email.rs:53:10:
email from address isn't valid: InvalidInput
It seems to be related to the smtp_from_address which we have set to Pawb.Social Lemmy <noreply@{{ domain }}>
(This is entirely an error on my part and apparently one of the variables didn't get copied across correctly, but it might be worth handling the InvalidInput to avoid it crashing out the entire process and log / note a warning somewhere).
Fixing the incorrect email (in our case) appears to have resolved the issue.
Thx! those logs help... I see some expects in that file which shouldn't be there.
Requirements
Summary
For various error / removal toasts, I'm getting a "Toastify is awesome!" message, rather than the intended message.
Steps to Reproduce
Technical Details
NA
Lemmy Instance Version
main
Lemmy Instance URL
https://voyager.lemmy.ml
EDIT: actually wait, comment removals and restore isn't the correct test. I'll have to find what's creating this.