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

[Enhancement] Improving background tasks #5405

Open
g123k opened this issue Jun 18, 2024 · 1 comment
Open

[Enhancement] Improving background tasks #5405

g123k opened this issue Jun 18, 2024 · 1 comment

Comments

@g123k
Copy link
Collaborator

g123k commented Jun 18, 2024

Hi everyone,

We get many complaints from users who don't understand why the application is acting weirdly.
Very often, the root cause is a long list of background tasks that hasn't been able to run.

In a way, background tasks are interesting for longer requests such as photos, but for "simple text", it's more questionable.

What I'd like to enable is the following algorithm on "simple" fields:

  1. Try to send the request immediately with a short timeout
  2. If this doesn't work, transform it into a background task.

Some examples of "simple" fields: update country, website…

@g123k g123k changed the title [Enhancement] Improve background tasks [Enhancement] Improving background tasks Jun 18, 2024
@monsieurtanuki
Copy link
Contributor

Hi @g123k!

The way background tasks work:

  • immediately setting the local product with the new changes
  • immediately giving back to the user the control of the app
  • putting a task in a queue, which is re-run on specific common events (e.g. opening a product page)

I don't know the "weird problems" you're talking about: could you please be more specific?

  • If it's that the server isn't updated at the same time as the app, that's not a bug, that's a feature: we can update products offline or when the server is down.
  • If it's that local data seems to change, it happens if the server doesn't change the data itself, cf. Locked products  #5394: the user changes the local data, the user sees the changed data locally, the server is called but doesn't change the data, the app downloads the unchanged data, the local data reverts to the value before the user change.

Would it be worth to let users know a bit about background tasks, with a sort of access to the current queue? Definitely. I'm pretty sure most of them have already downloaded a file and seen the download progress.

Some solutions to have more active processes:

  • splitting into several queues - e.g. one queue for the "simple" background tasks and one queue dedicated to heavy stuff like photo upload
  • calling BackgrounsTaskManager.run() in more cases

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: 💬 To discuss and validate
Development

No branches or pull requests

2 participants