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

Folksonomy + refresh, offline, background tasks #5861

Open
Tracked by #697
monsieurtanuki opened this issue Nov 15, 2024 · 3 comments
Open
Tracked by #697

Folksonomy + refresh, offline, background tasks #5861

monsieurtanuki opened this issue Nov 15, 2024 · 3 comments
Assignees
Labels
🔁 Background tasks folksonomy engine Free form modelling of products: https://wiki.openfoodfacts.org/Folksonomy_Engine

Comments

@monsieurtanuki
Copy link
Contributor

Problem

The new Folksonomy feature implemented by @gciluffo in #5768 needs to take into account several aspects of offline mode.
For instance, being able to add a folksonomy key/value with no access to internet.

Proposed solution

Using background tasks would make sense.

@monsieurtanuki
Copy link
Contributor Author

@gciluffo Do you feel like working on it, or do you prefer to recover first from that intense PR?
TBH it'd be better if I work on it - but you could review the PR.

@monsieurtanuki
Copy link
Contributor Author

This is what needs to be implemented:

  1. Refresh 1 product - when we refresh an OxF product, we should refresh its folksonomies, and there's an API to retrieve all of them
  2. Refresh several products - when we refresh a list of OxF products, we should refresh all their folksonomies. Unfortunately there's no API to retrieve all folksonomies of a list of products
  3. Store server data locally - in a dedicated SQFLite table, in order to access data even offline, and that's where we'll put the "refreshed" data mentioned above
  4. Store transient data locally - in a dedicated Hive table. When we add/update/delete a folksonomy, we use a background task, and until it's completed we consider a transient folksonomy on top of the server values
  5. Background tasks - for add/create/delete folksonomy operations. They start with setting the transient value, then they run the API operation if possible, then they refresh the data from the server and remove the transient data

@gciluffo
Copy link
Contributor

@gciluffo Do you feel like working on it, or do you prefer to recover first from that intense PR? TBH it'd be better if I work on it - but you could review the PR.

You can take this one if you want, I can definitly help review it!

@monsieurtanuki monsieurtanuki self-assigned this Nov 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🔁 Background tasks folksonomy engine Free form modelling of products: https://wiki.openfoodfacts.org/Folksonomy_Engine
Projects
Status: Todo
Status: 💬 To discuss and validate
Development

No branches or pull requests

3 participants