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

Invalid authentication sent to Robotoff during question answering #625

Closed
raphael0202 opened this issue Nov 21, 2022 · 2 comments · Fixed by #626
Closed

Invalid authentication sent to Robotoff during question answering #625

raphael0202 opened this issue Nov 21, 2022 · 2 comments · Fixed by #626

Comments

@raphael0202
Copy link

See https://sentry.io/organizations/openfoodfacts/issues/3749073432/events/2638e00077e54c64abf983aaedb71838/?project=1415205&referrer=previous-event

'null' is sometimes sent as username in during /insights/annotate call.

@monsieurtanuki
Copy link
Contributor

@raphael0202 Actually there are expected cases when the user is null, branded as "anonymousAnnotation" (in question_page.dart):

    if (OpenFoodAPIConfiguration.globalUser == null && insightId != null) {
      _anonymousAnnotationList.putIfAbsent(insightId, () => insightAnnotation);
    }
    await LoadingDialog.run<Status>(
      context: context,
      title: appLocalizations.saving_answer,
      future: OpenFoodAPIClient.postInsightAnnotation(
        insightId,
        insightAnnotation,
        deviceId: OpenFoodAPIConfiguration.uuid,
        user: OpenFoodAPIConfiguration.globalUser,
      ),
    );

There has been some refactoring here, so it's not easy to follow the history: which user should we use for those anonymous annotations?

@raphael0202
Copy link
Author

No authentication headers should be sent for anonymous annotations. The documentation is not up to date on that matter, sorry for that!

@monsieurtanuki monsieurtanuki self-assigned this Nov 22, 2022
monsieurtanuki added a commit to monsieurtanuki/openfoodfacts-dart that referenced this issue Nov 22, 2022
monsieurtanuki added a commit that referenced this issue Nov 22, 2022
Impacted file:
* `HttpHelper.dart`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants