Skip to content

[PERTE-235] Migrate to new v2 endpoints+events for tasks, task_list and tours #1968

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

Merged
merged 81 commits into from
Apr 16, 2025

Conversation

JuanIgAcosta
Copy link
Contributor

@JuanIgAcosta JuanIgAcosta commented Mar 17, 2025

Issue: #235

Relates to PR: coopcycle/coopcycle-web#4944


Start using the new enpoints described in the issue.

  • Change LOAD_UNASSIGNED_TASKS_SUCCESS with LOAD_TASKS_SUCCESS and get all tasks (assigned and unassigned) from backend (delete parameter "assigned" from request's params)
  • Load tasks, task lists and tours into states
  • Select a task list with related tasks (those that are directly related and also through tours)
  • Update tasks, task lists and/or tours using web sockets (PR #4944)
  • Show only selected date's tasks, task lists and tours
  • Update reducers tests
  • Filter events for the current date only
  • Once [PERTE-240] Fetch all tasks and couriers #1958 is merged, bring master here and test that everything works just fine! 😅
  • Make the order of tasks from a tour match between the web and the mobile app
  • When task/s from a tour is/are assigned from app, remove the task/s from the tour by calling PUT /api/tours/{id} to replace it with the tour's remaining tasks (even if it's left empty).
  • Replace import { createAction } from 'redux-actions'; by import { createAction } from '@reduxjs/toolkit' just at file: redux/Dispatch/actions.js
  • Make sure that unassign from app works as expected
    • Handle error response cases (the app hangs otherwise)
    • Update tours (unassing if the tasks that are going to be unassigned belongs to a tour and no tasks left in the tour)
  • Make sure to empty the tasks, tasklist and tours from store when the user logout/in?

@diegomanuel diegomanuel changed the title Feature/235 update task list endpoint [PERTE-235] Migrate to new v2 endpoints+events for tasks, task_list and tours Mar 20, 2025
@diegomanuel diegomanuel requested review from vladimir-8 and Atala April 14, 2025 15:10
Copy link
Member

@Atala Atala left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hello i noticed two problems

  1. problem when an empty tour is inserted into the tasklist -> the thing goes mad
  2. seems flaky when reordering tasks into a tasklist, sometimes update, sometimes not

I dont really understand from where the problem comes from, as if we use v2:task_list:updated event we just have to copy the data from there

see GIFs below

sync-app-and-web

flaky-reordering

@diegomanuel
Copy link
Member

diegomanuel commented Apr 15, 2025

hello i noticed two problems

It should be solved with our latests adjustments!
But take into consideration that the updates are a bit slow and takes a few seconds sometimes to update the user's task list in the app.
We tried moving lots of things (and quickly) from the web UI in order to break everything in the app UI but everything went fine! It took several seconds to process all the updates but it always ended up being in sync with web.

@diegomanuel diegomanuel requested a review from Atala April 15, 2025 20:14
@Atala
Copy link
Member

Atala commented Apr 16, 2025

I managed to break it in the android emulator:

  1. "delivery color" disapearring in the list of tasks

image

image

on the web

image

@Atala
Copy link
Member

Atala commented Apr 16, 2025

I have this warning as well when it updates can you fix it ?

image

@diegomanuel
Copy link
Member

diegomanuel commented Apr 16, 2025

  1. "delivery color" disapearring in the list of tasks
  2. ...

How to reproduce?!
We never managed to get that state in where the web shows 5 tasks and the app none.
The same for the colors.

  • Are you using your local backend or demo?
  • Could you record the screen instead of gif/jpgs?

@diegomanuel
Copy link
Member

I have this warning as well when it updates can you fix it ?

In which screen? We saw that problem from time to time already happening from the beginning, but it was always harmless.
Anyways, everything is going to be changed/updated with the new UI!

@diegomanuel diegomanuel merged commit fa51c58 into master Apr 16, 2025
5 of 6 checks passed
@diegomanuel diegomanuel deleted the feature/235-update-task-list-endpoint branch April 16, 2025 17:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Dispatch Interface An issue related to dispatch´s interface. Ex: The admin and orders dashboards, using matomo, tags Improve Performance
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants