mozilla-services / channelserver

🍐 A tool to associate instances of firefox.
Mozilla Public License 2.0
3 stars 6 forks source link

Strings being shown in German #83

Closed clouserw closed 3 years ago

clouserw commented 4 years ago

Firefox Accounts has a bug over here https://github.com/mozilla/fxa/issues/5426 where strings are showing up in German on desktop. The comments lead to channelserver and JR suggested I file this here. Please read the linked issue for context

jrconlin commented 4 years ago

The problem appears to be that the Accept-Language header is either not being processed correctly, or is not being sent to the ChannelServer. Working with @jbuck to isolate what the problem might be.

It does not appear that either the Accept-Language header or the code have changed radically.

I'm a bit curious why the problem is not present on mobile if the header is not being sent over.

jbuck commented 3 years ago

I've put up a PR that logs the Accept-Language header and also proxies it through to the app but I'm still getting Kanada when I sign in with my iOS device: https://github.com/mozilla-services/cloudops-infra/pull/2489

Logs can be seen with: https://console.cloud.google.com/logs/query;query=resource.type%3D%22k8s_container%22%20resource.labels.cluster_name%3D%22channelserver-prod-v1%22%20resource.labels.namespace_name%3D%22prod-channelserver%22%20resource.labels.container_name%3D%22nginx%22%0AjsonPayload.request!%3D%22GET%20%2F__lbheartbeat__%20HTTP%2F1.1%22;timeRange=2020-09-15T16:27:38.851Z%2F2020-09-15T16:34:38.851Z;summaryFields=jsonPayload%252FFields%252Fmsg,jsonPayload%252Faccept_language:false:32:beginning?folder=true&organizationId=true&project=moz-fx-channelserve-prod-c549&query=%0A

tublitzed commented 3 years ago

@jrconlin when you have a chance (no rush this week I know you're busy) can you detail what you found here? I'd like to try to sort out whether we think the optimal fix here should be done client vs server side.

jrconlin commented 3 years ago

Well, the "fix" is fairly straightforward, but I'm not sure it's best.

The problem is that if there's no "Accept-Language" header, or if the value is blank, then No Language Preference is provided to the geolocation library. This results in the first language (determined internally as "de"utsch) to be used. One potential fix is to just default "en" if no language is specified. That would solve this specific view of the problem, but is just as terrible as defaulting to German.

It's my understanding that this problem is inherent in iOS WebKit and that a workaround could be performed on the client. It would probably be better to solve this on the client than the server since the client has more knowledge about specific user preferences.

jrconlin commented 3 years ago

Based off of discussions, I've added a PR to enforce the default language to en.

I think the problem may have also been that - was not being filtered out as an invalid value.

vasilicatamas commented 3 years ago

@jrconlin should this fix already be available for testing in stage? Because I still see the location as being written in Germen.

jbuck commented 3 years ago

@vasilicatamas Hmm, I wonder if the stage FxA uses the prod channelserver... that'd explain why the fix isn't present yet

jbuck commented 3 years ago

To answer my own question, the answer is 'yes':

projects/fxa/puppet/yaml/type/fxa.content_server.dev.yaml
27:fxa_content::pairing_server_base_uri: wss://dev.channelserver.nonprod.cloudops.mozgcp.net

projects/fxa/puppet/yaml/type/fxa.content_server.prod.yaml
27:fxa_content::pairing_server_base_uri: wss://channelserver.services.mozilla.com

projects/fxa/puppet/yaml/type/fxa.content_server.stage.yaml
45:fxa_content::pairing_server_base_uri: wss://channelserver.services.mozilla.com

I can change this config, but do we need to change something in Firefox to use the stage channel server as well?

rfk commented 3 years ago

I can change this config, but do we need to change something in Firefox to use the stage channel server as well?

Firefox should use whatever URL is advertized in the client-config document:

jbuck commented 3 years ago

@rfk excellent, thanks for checking that!

@vasilicatamas I will update this bug when fxa stage is pointing at channelserver stage

jbuck commented 3 years ago

PR up in https://github.com/mozilla-services/cloudops-deployment/pull/4046

jbuck commented 3 years ago

@vasilicatamas stage fxa is pointing at stage channelserver now

vasilicatamas commented 3 years ago

Thanks @jbuck! I confirm that the location is no longer translated in German. Tested on FxA Stage [Train 1.191.1] under Windows 10 64-bit. Screenshot_25

vasilicatamas commented 3 years ago

@jbuck Do you have any idea about when this fix will land in production? Because it seems that it isn't yet in FxA Prod Train 1.191.1.

Screenshot_36

jrconlin commented 3 years ago

Ah, normally QA submits a bugzilla ticket whenever the channelserver passes testing. I'm guessing that this didn't happen, probably due to the various confusion around who has channelserver support now.

IIRC: The ticket should be filed under Cloud Services; Operations: Sync with a title like: Please deploy Channelserver 1.0.0 to PROD. I've taken the liberty of filing that bug, please adjust as need be.

jbuck commented 3 years ago

@vasilicatamas channelserver 1.0 is now deployed in production

vasilicatamas commented 3 years ago

I confirm that the location is no longer translated in German on FxA Prod [Train 1.192.0] under Windows 10 64-bit.

Screenshot_29