Replies: 6 comments
-
|
Beta Was this translation helpful? Give feedback.
-
On my end i was thinking of kind of keep the same interface as before for the TaskList object :
I think it will work well with the IDs from ApiPlatform, because thanks to this we know most of the time if the object is a task or a tour (with the use of getItemFromIri) |
Beta Was this translation helpful? Give feedback.
-
So ok at first I proposed that So I think you proposal is 👍, i.e a So, the ordering of a Tour is always stored in the tour itself, not in the TaskList. |
Beta Was this translation helpful? Give feedback.
-
FindingsA tasklist implements (Task)CollectionInterface by extending TaskCollection These are the functions of (Task)CollectionInterface. It seems that we want to keep all of them implemented by TaskList so keep it as is. We need to modify getTasks so it takes the tasks from a tour if item is a tour.
here are the other functions that are implemented by TaskCollection function getItems -> serialize the tasklist, should be used to serialize mixed of tours and tasks function addTask -> very important for tasklist as it synchronizes task.isAssigned and task.assignedTo fields. so should work with the new tour thing as well. function setTasks -> should be renamed to setItems and set tours and tasks function findAt -> seems not used anymore, could be deleted? utility functions used to display a delivery state, so maybe no use here
src/Doctrine/EventSubscriber/TaskSubscriber/EntityChangeSetProcessor.php
Web dispatch
AppPull : api/me/tasks -> it should still work this way Centrifugo/websocket This will broke updateTask which will be called when task:assigned and task:unassigned are updated. because it updates tasklist directly but I think it is already broken with tours anyway. Make it work with tours right now or postpone it. we will need it in the app also. TaskListNormalizer -> maybe delete it? it is used to "flattenItems" but maybe it is a legacy bug ?TaskListCollectionDataProvider -> is used by tricargo at something like /api/stores/1 -> find the spec and see if it fitsDatabaseOption 1 : keep TaskList based on TaskCollection, just change TaskCollectionItem so it has extra foreign key to Tours (maybe rename stuff) Option 2 : move TaskList out of TaskCollection, create a new intermediate table TaskListItem for position tracking |
Beta Was this translation helpful? Give feedback.
-
TaskListItem
taskList->getItems() , taskList->setItems() |
Beta Was this translation helpful? Give feedback.
-
Actually I was stuck with the "inheritance" approach as So i went with the "two foreign keys" approach also i think it may be profitable for performance, as i will only need to fetch |
Beta Was this translation helpful? Give feedback.
-
👋
there is a design issue with tours & tasklists, as they are both designed as list of tasks with independent indexes/position. it was very fine at the beginning, because having them both as list of tasks enable very easy prototyping. also very easy to prototype on web side without changing the app code. however now it causes serious bugs and DB inacurracy when there are some flaws in the client or somewhere in the code.
Current state
CollectionItem
that tracks the list of tasksProblem(s)
- if your code is mistaken (for example recently bug in the optimizer), you can reorder the taskslist without reordering the tour. if you dont update both objects on the client side then you may lose sync between the two, especially when you modify an existing tour
Solution(s)
I tried to figure out a solution that could synchronize tour order and tasklist order but I could not. also what is complicated is that if you force the change of task orders or fail on the backend side then you have to reflect on the client(s).
So I propose the following :
This will lead to simplification and I think it is the only way to have good synchronization between all these parts, but also to (big) changes in the clients (web and app) and maybe in the backend code (not 100% sure).
Thoughts?
Beta Was this translation helpful? Give feedback.
All reactions