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

[Fast-track] Adding a photo with another language is not recognized as "added" #5245

Closed
g123k opened this issue May 13, 2024 · 2 comments · Fixed by #5278
Closed

[Fast-track] Adding a photo with another language is not recognized as "added" #5245

g123k opened this issue May 13, 2024 · 2 comments · Fixed by #5278
Assignees
Labels
🐛 bug Something isn't working Product addition The easier it is to add a product and get Nutri-Score, Eco-Score, the happier the users.

Comments

@g123k
Copy link
Collaborator

g123k commented May 13, 2024

Hi everyone,

When we have what we call the "Fast-track" screen (= non-existing product), we first ask for photos.
However, if a photo is taken in a language different from the default one, we never have the green mark

In the video of #5226, we can see the issue at 00:25
https://github.com/openfoodfacts/smooth-app/assets/246838/05ce073d-4ed5-40ae-88e6-45b894c86891

@g123k g123k added 🐛 bug Something isn't working Product addition The easier it is to add a product and get Nutri-Score, Eco-Score, the happier the users. labels May 13, 2024
@g123k g123k self-assigned this May 13, 2024
@g123k
Copy link
Collaborator Author

g123k commented May 17, 2024

Today, the button turns green when a photo with the correct type/(default) language is available.
The problem is when the photo was taken in a different language.

Here are a few possible fixes:

  • The photo screen returns a Boolean to indicate whether a photo has been added/edited.
  • The photo screen returns a List of languages added/modified.
    -> Option 1: In both cases, if the result is not empty, we can assume it's OK

But the photo may still be sent in the background.
Option2: Should we then go with a List of languages AND do the same check as today… but with the correct language

(cc @monsieurtanuki @teolemon)

@monsieurtanuki
Copy link
Contributor

@g123k Actually we don't care if the background task hasn't been completed yet: we override the product with the pending data.

Quickly said: I would have a look at BackgroundTaskUpload, method getProductChange and

  @override
  Future<void> preExecute(final LocalDatabase localDatabase) async {
    await localDatabase.upToDate.addChange(
      uniqueId,
      getProductChange(),
    );
    await putTransientImage(localDatabase);
  }

Including UpToDateChanges._overwrite too, the way it deals with images.

Then, I guess looping the product images looking for at least one "nutrition" picture would be enough.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working Product addition The easier it is to add a product and get Nutri-Score, Eco-Score, the happier the users.
2 participants