lila icon indicating copy to clipboard operation
lila copied to clipboard

"Change currency" in the donation page does not work

Open hhu94 opened this issue 2 years ago • 10 comments

When I try to change the currency from DKK to USD it does not work, it stays as DKK.

image

hhu94 avatar Aug 18 '22 17:08 hhu94

Does the page reload once you select USD? It should contain currency=USD in the URL after you select it. Do you see any errors in the browser console? (usually F12 to open) Which browser and OS?

benediktwerner avatar Aug 18 '22 18:08 benediktwerner

I saw the problem when @hhu94 reported it, but now it's working ...

I don't see any commits to the code though ... 🤔

yafred avatar Aug 20 '22 14:08 yafred

I'm using Windows 11 OS Build 22000.856 and Microsoft Edge version 104.0.1293.63.

It still does not work for me. The page does reload but the URL never contains currency=USD.

The console shows the below errors:

Error with Permissions-Policy header: Origin trial controlled feature not enabled: 'interest-cohort'.
lichess.min.js:36 Lichess is open source! https://lichess.org/source
js?client-id=AbvqvIWE9Cl9TuGtedhujmHoFOFJi70Ri9diXF0g7COcCZKzQ4IJ8E7wqq83tqLWa0uqzrM8uy3aYAok&currency=DKK&locale=en_US:2 
        
       Refused to execute inline script because it violates the following Content Security Policy directive: "script-src https://*.paypal.com https://*.stripe.com 'nonce-4rIgC1CN5AbHi9odhqV9P452' 'self' lichess1.org". Either the 'unsafe-inline' keyword, a hash ('sha256-YPQEktmczDdInuprG6bexCvqCMOlpn8BfJrMgjZRNLY='), or a nonce ('nonce-...') is required to enable inline execution.

Pn @ js?client-id=AbvqvIWE9Cl9TuGtedhujmHoFOFJi70Ri9diXF0g7COcCZKzQ4IJ8E7wqq83tqLWa0uqzrM8uy3aYAok&currency=DKK&locale=en_US:2
(anonymous) @ js?client-id=AbvqvIWE9Cl9TuGtedhujmHoFOFJi70Ri9diXF0g7COcCZKzQ4IJ8E7wqq83tqLWa0uqzrM8uy3aYAok&currency=DKK&locale=en_US:2
e.try @ js?client-id=AbvqvIWE9Cl9TuGtedhujmHoFOFJi70Ri9diXF0g7COcCZKzQ4IJ8E7wqq83tqLWa0uqzrM8uy3aYAok&currency=DKK&locale=en_US:2
Ue @ js?client-id=AbvqvIWE9Cl9TuGtedhujmHoFOFJi70Ri9diXF0g7COcCZKzQ4IJ8E7wqq83tqLWa0uqzrM8uy3aYAok&currency=DKK&locale=en_US:2
(anonymous) @ js?client-id=AbvqvIWE9Cl9TuGtedhujmHoFOFJi70Ri9diXF0g7COcCZKzQ4IJ8E7wqq83tqLWa0uqzrM8uy3aYAok&currency=DKK&locale=en_US:2
n.dispatch @ js?client-id=AbvqvIWE9Cl9TuGtedhujmHoFOFJi70Ri9diXF0g7COcCZKzQ4IJ8E7wqq83tqLWa0uqzrM8uy3aYAok&currency=DKK&locale=en_US:2
n.resolve @ js?client-id=AbvqvIWE9Cl9TuGtedhujmHoFOFJi70Ri9diXF0g7COcCZKzQ4IJ8E7wqq83tqLWa0uqzrM8uy3aYAok&currency=DKK&locale=en_US:2
n.dispatch @ js?client-id=AbvqvIWE9Cl9TuGtedhujmHoFOFJi70Ri9diXF0g7COcCZKzQ4IJ8E7wqq83tqLWa0uqzrM8uy3aYAok&currency=DKK&locale=en_US:2
n.resolve @ js?client-id=AbvqvIWE9Cl9TuGtedhujmHoFOFJi70Ri9diXF0g7COcCZKzQ4IJ8E7wqq83tqLWa0uqzrM8uy3aYAok&currency=DKK&locale=en_US:2
(anonymous) @ js?client-id=AbvqvIWE9Cl9TuGtedhujmHoFOFJi70Ri9diXF0g7COcCZKzQ4IJ8E7wqq83tqLWa0uqzrM8uy3aYAok&currency=DKK&locale=en_US:2
n.dispatch @ js?client-id=AbvqvIWE9Cl9TuGtedhujmHoFOFJi70Ri9diXF0g7COcCZKzQ4IJ8E7wqq83tqLWa0uqzrM8uy3aYAok&currency=DKK&locale=en_US:2
n.resolve @ js?client-id=AbvqvIWE9Cl9TuGtedhujmHoFOFJi70Ri9diXF0g7COcCZKzQ4IJ8E7wqq83tqLWa0uqzrM8uy3aYAok&currency=DKK&locale=en_US:2
n.dispatch @ js?client-id=AbvqvIWE9Cl9TuGtedhujmHoFOFJi70Ri9diXF0g7COcCZKzQ4IJ8E7wqq83tqLWa0uqzrM8uy3aYAok&currency=DKK&locale=en_US:2
n.resolve @ js?client-id=AbvqvIWE9Cl9TuGtedhujmHoFOFJi70Ri9diXF0g7COcCZKzQ4IJ8E7wqq83tqLWa0uqzrM8uy3aYAok&currency=DKK&locale=en_US:2
(anonymous) @ js?client-id=AbvqvIWE9Cl9TuGtedhujmHoFOFJi70Ri9diXF0g7COcCZKzQ4IJ8E7wqq83tqLWa0uqzrM8uy3aYAok&currency=DKK&locale=en_US:2
n.dispatch @ js?client-id=AbvqvIWE9Cl9TuGtedhujmHoFOFJi70Ri9diXF0g7COcCZKzQ4IJ8E7wqq83tqLWa0uqzrM8uy3aYAok&currency=DKK&locale=en_US:2
n.resolve @ js?client-id=AbvqvIWE9Cl9TuGtedhujmHoFOFJi70Ri9diXF0g7COcCZKzQ4IJ8E7wqq83tqLWa0uqzrM8uy3aYAok&currency=DKK&locale=en_US:2
(anonymous) @ js?client-id=AbvqvIWE9Cl9TuGtedhujmHoFOFJi70Ri9diXF0g7COcCZKzQ4IJ8E7wqq83tqLWa0uqzrM8uy3aYAok&currency=DKK&locale=en_US:2
n.dispatch @ js?client-id=AbvqvIWE9Cl9TuGtedhujmHoFOFJi70Ri9diXF0g7COcCZKzQ4IJ8E7wqq83tqLWa0uqzrM8uy3aYAok&currency=DKK&locale=en_US:2
n.resolve @ js?client-id=AbvqvIWE9Cl9TuGtedhujmHoFOFJi70Ri9diXF0g7COcCZKzQ4IJ8E7wqq83tqLWa0uqzrM8uy3aYAok&currency=DKK&locale=en_US:2
n.dispatch @ js?client-id=AbvqvIWE9Cl9TuGtedhujmHoFOFJi70Ri9diXF0g7COcCZKzQ4IJ8E7wqq83tqLWa0uqzrM8uy3aYAok&currency=DKK&locale=en_US:2
n.resolve @ js?client-id=AbvqvIWE9Cl9TuGtedhujmHoFOFJi70Ri9diXF0g7COcCZKzQ4IJ8E7wqq83tqLWa0uqzrM8uy3aYAok&currency=DKK&locale=en_US:2
n.dispatch @ js?client-id=AbvqvIWE9Cl9TuGtedhujmHoFOFJi70Ri9diXF0g7COcCZKzQ4IJ8E7wqq83tqLWa0uqzrM8uy3aYAok&currency=DKK&locale=en_US:2
n.resolve @ js?client-id=AbvqvIWE9Cl9TuGtedhujmHoFOFJi70Ri9diXF0g7COcCZKzQ4IJ8E7wqq83tqLWa0uqzrM8uy3aYAok&currency=DKK&locale=en_US:2
n.dispatch @ js?client-id=AbvqvIWE9Cl9TuGtedhujmHoFOFJi70Ri9diXF0g7COcCZKzQ4IJ8E7wqq83tqLWa0uqzrM8uy3aYAok&currency=DKK&locale=en_US:2
n.resolve @ js?client-id=AbvqvIWE9Cl9TuGtedhujmHoFOFJi70Ri9diXF0g7COcCZKzQ4IJ8E7wqq83tqLWa0uqzrM8uy3aYAok&currency=DKK&locale=en_US:2
(anonymous) @ js?client-id=AbvqvIWE9Cl9TuGtedhujmHoFOFJi70Ri9diXF0g7COcCZKzQ4IJ8E7wqq83tqLWa0uqzrM8uy3aYAok&currency=DKK&locale=en_US:2
(anonymous) @ js?client-id=AbvqvIWE9Cl9TuGtedhujmHoFOFJi70Ri9diXF0g7COcCZKzQ4IJ8E7wqq83tqLWa0uqzrM8uy3aYAok&currency=DKK&locale=en_US:2
js?client-id=AbvqvIWE9Cl9TuGtedhujmHoFOFJi70Ri9diXF0g7COcCZKzQ4IJ8E7wqq83tqLWa0uqzrM8uy3aYAok&vault=true&intent=subscription&currency=DKK&locale=en_US:2 
        
       Refused to execute inline script because it violates the following Content Security Policy directive: "script-src https://*.paypal.com https://*.stripe.com 'nonce-4rIgC1CN5AbHi9odhqV9P452' 'self' lichess1.org". Either the 'unsafe-inline' keyword, a hash ('sha256-YPQEktmczDdInuprG6bexCvqCMOlpn8BfJrMgjZRNLY='), or a nonce ('nonce-...') is required to enable inline execution.

Pn @ js?client-id=AbvqvIWE9Cl9TuGtedhujmHoFOFJi70Ri9diXF0g7COcCZKzQ4IJ8E7wqq83tqLWa0uqzrM8uy3aYAok&vault=true&intent=subscription&currency=DKK&locale=en_US:2
(anonymous) @ js?client-id=AbvqvIWE9Cl9TuGtedhujmHoFOFJi70Ri9diXF0g7COcCZKzQ4IJ8E7wqq83tqLWa0uqzrM8uy3aYAok&vault=true&intent=subscription&currency=DKK&locale=en_US:2
e.try @ js?client-id=AbvqvIWE9Cl9TuGtedhujmHoFOFJi70Ri9diXF0g7COcCZKzQ4IJ8E7wqq83tqLWa0uqzrM8uy3aYAok&vault=true&intent=subscription&currency=DKK&locale=en_US:2
Ue @ js?client-id=AbvqvIWE9Cl9TuGtedhujmHoFOFJi70Ri9diXF0g7COcCZKzQ4IJ8E7wqq83tqLWa0uqzrM8uy3aYAok&vault=true&intent=subscription&currency=DKK&locale=en_US:2
(anonymous) @ js?client-id=AbvqvIWE9Cl9TuGtedhujmHoFOFJi70Ri9diXF0g7COcCZKzQ4IJ8E7wqq83tqLWa0uqzrM8uy3aYAok&vault=true&intent=subscription&currency=DKK&locale=en_US:2
n.dispatch @ js?client-id=AbvqvIWE9Cl9TuGtedhujmHoFOFJi70Ri9diXF0g7COcCZKzQ4IJ8E7wqq83tqLWa0uqzrM8uy3aYAok&vault=true&intent=subscription&currency=DKK&locale=en_US:2
n.resolve @ js?client-id=AbvqvIWE9Cl9TuGtedhujmHoFOFJi70Ri9diXF0g7COcCZKzQ4IJ8E7wqq83tqLWa0uqzrM8uy3aYAok&vault=true&intent=subscription&currency=DKK&locale=en_US:2
n.dispatch @ js?client-id=AbvqvIWE9Cl9TuGtedhujmHoFOFJi70Ri9diXF0g7COcCZKzQ4IJ8E7wqq83tqLWa0uqzrM8uy3aYAok&vault=true&intent=subscription&currency=DKK&locale=en_US:2
n.resolve @ js?client-id=AbvqvIWE9Cl9TuGtedhujmHoFOFJi70Ri9diXF0g7COcCZKzQ4IJ8E7wqq83tqLWa0uqzrM8uy3aYAok&vault=true&intent=subscription&currency=DKK&locale=en_US:2
(anonymous) @ js?client-id=AbvqvIWE9Cl9TuGtedhujmHoFOFJi70Ri9diXF0g7COcCZKzQ4IJ8E7wqq83tqLWa0uqzrM8uy3aYAok&vault=true&intent=subscription&currency=DKK&locale=en_US:2
n.dispatch @ js?client-id=AbvqvIWE9Cl9TuGtedhujmHoFOFJi70Ri9diXF0g7COcCZKzQ4IJ8E7wqq83tqLWa0uqzrM8uy3aYAok&vault=true&intent=subscription&currency=DKK&locale=en_US:2
n.resolve @ js?client-id=AbvqvIWE9Cl9TuGtedhujmHoFOFJi70Ri9diXF0g7COcCZKzQ4IJ8E7wqq83tqLWa0uqzrM8uy3aYAok&vault=true&intent=subscription&currency=DKK&locale=en_US:2
n.dispatch @ js?client-id=AbvqvIWE9Cl9TuGtedhujmHoFOFJi70Ri9diXF0g7COcCZKzQ4IJ8E7wqq83tqLWa0uqzrM8uy3aYAok&vault=true&intent=subscription&currency=DKK&locale=en_US:2
n.resolve @ js?client-id=AbvqvIWE9Cl9TuGtedhujmHoFOFJi70Ri9diXF0g7COcCZKzQ4IJ8E7wqq83tqLWa0uqzrM8uy3aYAok&vault=true&intent=subscription&currency=DKK&locale=en_US:2
(anonymous) @ js?client-id=AbvqvIWE9Cl9TuGtedhujmHoFOFJi70Ri9diXF0g7COcCZKzQ4IJ8E7wqq83tqLWa0uqzrM8uy3aYAok&vault=true&intent=subscription&currency=DKK&locale=en_US:2
n.dispatch @ js?client-id=AbvqvIWE9Cl9TuGtedhujmHoFOFJi70Ri9diXF0g7COcCZKzQ4IJ8E7wqq83tqLWa0uqzrM8uy3aYAok&vault=true&intent=subscription&currency=DKK&locale=en_US:2
n.resolve @ js?client-id=AbvqvIWE9Cl9TuGtedhujmHoFOFJi70Ri9diXF0g7COcCZKzQ4IJ8E7wqq83tqLWa0uqzrM8uy3aYAok&vault=true&intent=subscription&currency=DKK&locale=en_US:2
(anonymous) @ js?client-id=AbvqvIWE9Cl9TuGtedhujmHoFOFJi70Ri9diXF0g7COcCZKzQ4IJ8E7wqq83tqLWa0uqzrM8uy3aYAok&vault=true&intent=subscription&currency=DKK&locale=en_US:2
n.dispatch @ js?client-id=AbvqvIWE9Cl9TuGtedhujmHoFOFJi70Ri9diXF0g7COcCZKzQ4IJ8E7wqq83tqLWa0uqzrM8uy3aYAok&vault=true&intent=subscription&currency=DKK&locale=en_US:2
n.resolve @ js?client-id=AbvqvIWE9Cl9TuGtedhujmHoFOFJi70Ri9diXF0g7COcCZKzQ4IJ8E7wqq83tqLWa0uqzrM8uy3aYAok&vault=true&intent=subscription&currency=DKK&locale=en_US:2
n.dispatch @ js?client-id=AbvqvIWE9Cl9TuGtedhujmHoFOFJi70Ri9diXF0g7COcCZKzQ4IJ8E7wqq83tqLWa0uqzrM8uy3aYAok&vault=true&intent=subscription&currency=DKK&locale=en_US:2
n.resolve @ js?client-id=AbvqvIWE9Cl9TuGtedhujmHoFOFJi70Ri9diXF0g7COcCZKzQ4IJ8E7wqq83tqLWa0uqzrM8uy3aYAok&vault=true&intent=subscription&currency=DKK&locale=en_US:2
n.dispatch @ js?client-id=AbvqvIWE9Cl9TuGtedhujmHoFOFJi70Ri9diXF0g7COcCZKzQ4IJ8E7wqq83tqLWa0uqzrM8uy3aYAok&vault=true&intent=subscription&currency=DKK&locale=en_US:2
n.resolve @ js?client-id=AbvqvIWE9Cl9TuGtedhujmHoFOFJi70Ri9diXF0g7COcCZKzQ4IJ8E7wqq83tqLWa0uqzrM8uy3aYAok&vault=true&intent=subscription&currency=DKK&locale=en_US:2
n.dispatch @ js?client-id=AbvqvIWE9Cl9TuGtedhujmHoFOFJi70Ri9diXF0g7COcCZKzQ4IJ8E7wqq83tqLWa0uqzrM8uy3aYAok&vault=true&intent=subscription&currency=DKK&locale=en_US:2
n.resolve @ js?client-id=AbvqvIWE9Cl9TuGtedhujmHoFOFJi70Ri9diXF0g7COcCZKzQ4IJ8E7wqq83tqLWa0uqzrM8uy3aYAok&vault=true&intent=subscription&currency=DKK&locale=en_US:2
(anonymous) @ js?client-id=AbvqvIWE9Cl9TuGtedhujmHoFOFJi70Ri9diXF0g7COcCZKzQ4IJ8E7wqq83tqLWa0uqzrM8uy3aYAok&vault=true&intent=subscription&currency=DKK&locale=en_US:2
(anonymous) @ js?client-id=AbvqvIWE9Cl9TuGtedhujmHoFOFJi70Ri9diXF0g7COcCZKzQ4IJ8E7wqq83tqLWa0uqzrM8uy3aYAok&vault=true&intent=subscription&currency=DKK&locale=en_US:2
pptm.js?id=lichess.org&t=xo&v=5.0.330&source=payments_sdk&client_id=AbvqvIWE9Cl9TuGtedhujmHoFOFJi70Ri9diXF0g7COcCZKzQ4IJ8E7wqq83tqLWa0uqzrM8uy3aYAok&vault=false:1 
        
       Refused to load the script 'https://www.paypalobjects.com/muse/muse.js' because it violates the following Content Security Policy directive: "script-src https://*.paypal.com https://*.stripe.com 'nonce-4rIgC1CN5AbHi9odhqV9P452' 'self' lichess1.org". Note that 'script-src-elem' was not explicitly set, so 'script-src' is used as a fallback.

hhu94 avatar Aug 21 '22 12:08 hhu94

Can't reproduce. Those errors above are expected. It's just PayPal analytics getting blocked. One person that had the same issue reported it was fixed in incognito mode so chances are it's an extension causing this. Make sure it still doesn't work in incognito, a fresh browser, or when disabling all extensions.

benediktwerner avatar Aug 25 '22 06:08 benediktwerner

Update: for me, it reproduces even with a new, up-to-date, clean instance of Chrome in incognito mode. It looks like when selecting a different currency (EUR in my case), it's making a GET request to /list?currency=EUR&freq=monthly&dest=me, receives a status code 303 with the redirect location being /patron, does the redirect, but doesn't update the currency.

almunteanu avatar Aug 25 '22 14:08 almunteanu

@almunteanu can you open the Chrome developer view - network activity (only doc) before you try to change the currency.

Here is what I see when I am on https://lichess.org/patron (my default currency is Euro) and I change the currency to British Pounds

patron network

The result is that I am redirected to https://lichess.org/patron/list?currency=GBP&freq=monthly&dest=me and the amounts are now shown in British Pounds

When this issue was open I tried on Firefox and I did see the behaviour you describe. If I remember well the network view was showing that both /patron and list?currency=GBP&freq=monthly&dest=me were fetched with a Race Cache With Network.

yafred avatar Aug 25 '22 22:08 yafred

@yafred This is what I get: image

The first item is different from yours. Tried to spend some time to investigate why, but to no avail.


Edit: I managed to get it working. I clicked on the 'Credit Card' button, which redirected me to the Stripe checkout, then went back to lichess and tried again to select a value from the dropdown, and this time it worked, the currency was updated.

Edit 2: Further attempts are also successful. Looks like accessing the checkout once solves the problem once and for all.

almunteanu avatar Aug 26 '22 16:08 almunteanu

Since this has a not-reproducible label: I am hitting the same issue with Firefox 107.0.1 on macOS 13.0.1. Attached the screenshot of the network requests after selecting the new currency.With the correct query parameters, I am also getting the 303 redirect to patron without query parameters. I disabled cache for this.

Anything I can further do to help debug this? I have not yet tried the workaround (going to checkout first) in case I can help better like this.

Screenshot 2022-12-09 at 09 14 08

adsche avatar Dec 09 '22 15:12 adsche

I had the same problem, changing currency does not work. However once you pressed the donate button once and go to checkout and return it appears to be working. Tested on the Version 120.0.1 of Firefox and Version 120.0.xxx of Chrome

HaonRekcef avatar Dec 13 '23 14:12 HaonRekcef

I am having the same problem. Steps:

  1. Login
  2. Go to Donation page
  3. Click on change currency (in my case BRL)
  4. It does not work

What it should do: Change currency What happens: It looks like it is in a loop that keeps reset into default USD.

Tested in Firefox 121.0.1 Fedora Linux 39. I have all extensions disabled, and set Normal protection into tracking and also standard setup DNS over HTTPS. No results.

rodtell avatar Jan 21 '24 11:01 rodtell

I have the same issue. I click “Change currency”, choose “US$”, the page reloads with the old currency. The “Donate” button doesn't work as well. It reproduces 100% of the time, I am unable to change the currency or to donate in the default currency. Tested in Chrome 126.0.6478.62 and Firefox 127.0.1 under Windows 11 Home version 22H2.

The console log looks like this (both when the page loads initially and after the attempted change of currency): image

amatveiakin avatar Jun 22 '24 12:06 amatveiakin

https://github.com/lichess-org/lila/commit/e82d276a5176538875b34747eeff1bb7dbff4a7d

ornicar avatar Jun 23 '24 22:06 ornicar