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

The nutri-score v2 moderator only knowledge panel is not visible anymore #5224

Closed
teolemon opened this issue May 6, 2024 · 23 comments
Closed

Comments

@teolemon
Copy link
Member

teolemon commented May 6, 2024

What

  • The nutri-score v2 moderator only knowledge panel is not visible anymore
@monsieurtanuki
Copy link
Contributor

@teolemon Probably linked to the fact that the cookie is null.

@teolemon
Copy link
Member Author

teolemon commented May 6, 2024

@stephanegigandet for some reason, the cookie is null.

@monsieurtanuki
Copy link
Contributor

@stephanegigandet We expect the cookie in headers?['set-cookie'] after a call to auth.pl.
Something has changed recently?

@teolemon
Copy link
Member Author

teolemon commented May 6, 2024

it's weird, because I believe nothing has changed server side, this API is superrecent.
@monsieurtanuki did you ever manage to see the new Nutri-Score on products ?

@monsieurtanuki
Copy link
Contributor

it's weird, because I believe nothing has changed server side, this API is superrecent.

Could be a merge issue in off-dart. In my latest PR, I rebuilt the generated files as needed, and found out that the "user" generated file changed, unexpectedly. I'll have a look at it today.

@monsieurtanuki did you ever manage to see the new Nutri-Score on products ?

Never, but as I currently struggle to even run the app due to "macbook/android emulator/api 34" BS I strongly limit my use of the app.

@monsieurtanuki
Copy link
Contributor

@teolemon @stephanegigandet We're supposed to get a "cookie" somewhere, but that's not there.

Response body:

{
  "status":1,
  "status_verbose":"user signed-in",
  "user":{
    "admin":0,
    "country":"",
    "moderator":0,
    "name":"the user name",
    "preferred_language":"en"
  },
  "user_id":"grumpf"
}

Response header:

{
  connection: keep-alive,
  access-control-allow-origin: *,
  transfer-encoding: chunked,
  date: Mon, 06 May 2024 15:40:35 GMT,
  strict-transport-security: max-age=63072000,
  access-control-expose-headers: Content-Length,Content-Range,
  content-type: application/json; charset=utf-8,
  x-xss-protection: 1; mode=block,
  server: nginx/1.18.0,
  x-request-id: 5gj3d4KDRYZYrtyV,
  access-control-allow-headers: DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range,If-None-Match,Authorization,
  access-control-allow-methods: HEAD, GET, PATCH, POST, PUT, OPTIONS,
  x-download-options: noopen,
  x-content-type-options: nosniff,nosniff
}

Our input is a POST to cgi/auth.pl, with

  • header: {Accept: application/json, User-Agent: - off-dart integration tests, From: grumpf}
  • body: {body: 1, comment: dart API test, user_id: grumpf, password: ****, app_name: off-dart integration tests}

@teolemon
Copy link
Member Author

teolemon commented May 7, 2024

Discussed yesterday evening with @stephanegigandet , and nothing has changed server side

@monsieurtanuki
Copy link
Contributor

@teolemon I've just had a look at @g123k's related PRs, and the files are 99% untouched:

I've never seen the new nutriscore logos in the app.
Could it be that the cookie feature was only tested on emulators, and not on devices?

@g123k
Copy link
Collaborator

g123k commented May 7, 2024

I'm sorry I'm abroad and don't have access to a computer.
But as a reminder, the server was not deployed and switching to DEV was mandatory

@monsieurtanuki
Copy link
Contributor

arigatou g123k san.

@teolemon
Copy link
Member Author

teolemon commented May 7, 2024

@monsieurtanuki @g123k DEV does not improve the shebang: it's already been deployed to .org if you're logged in: https://fr.openfoodfacts.org/produit/4613448779566/chocapic#

@teolemon
Copy link
Member Author

teolemon commented May 7, 2024

image

@monsieurtanuki
Copy link
Contributor

@teolemon @stephanegigandet Regardless of the new nutriscore being deployed in DEV, TEST or PROD, our problem is that cookies are NOT returned by the PROD server through auth.pl.
But they are by the TEST server, something like:
set-cookie: session=user_id&openfoodfacts-dart&user_session&NYF1KHwKQe71Wce7EvcJepGqN9lm1cQJzSP52OcnUj5i4n2hnTm6kHJsN0C4hnkW; domain=.openfoodfacts.net; path=/; SameSite=Lax

So as long as we don't get cookie, we won't send them back, and we won't get new nutriscore depending on the sent cookie.

If it's not a matter of code difference between PROD and TEST, maybe it's a server parameter. Worst case scenario: a server parameter that cannot be set to this value in production.

@stephanegigandet
Copy link
Contributor

@monsieurtanuki the auth.pl cookie is not in prod in .org yet, it will be deployed early this week.

@g123k
Copy link
Collaborator

g123k commented May 16, 2024

It's ok for me after a sign-out/log-in:
Screenshot 2024-05-16 at 10 29 43

Could you confirm this works for you?

@monsieurtanuki
Copy link
Contributor

I don't know if I'm supposed to see it, but anyway I don't see the new formula.

@g123k
Copy link
Collaborator

g123k commented May 17, 2024

I don't know if I'm supposed to see it, but anyway I don't see the new formula.

Or maybe, do your account have moderator rights?
(cc @teolemon)

@teolemon
Copy link
Member Author

@monsieurtanuki are you using .net, and is your country set to Germany ?

@teolemon
Copy link
Member Author

(you are a moderator anyway)

@teolemon
Copy link
Member Author

(but @stephanegigandet made the Nutri-Score generally available outside France on .net)

@monsieurtanuki
Copy link
Contributor

I've just tested successfully with .net, Andorra and English:
image

@g123k
Copy link
Collaborator

g123k commented May 18, 2024

Ok, so perfect.
So I guess we can close this issue, isn't it?

@teolemon
Copy link
Member Author

Indeed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

4 participants