Summary:
When a user has already loaded their task list, any tasks assigned afterward are not reflected in the UI because the task list remains cached. The user only sees the new tasks after a full session refresh (e.g., logout/login).
Add a real-time notification mechanism so that task assignment events trigger cache invalidation and a task list re-fetch on the client.
Issue: If a new task is assigned to a user after they have already loaded their task list, the frontend continues showing the cached task list and does not become aware of the newly assigned task. The user only sees the new task after a logout/login cycle (or another action that forces a refresh).
Expected Behavior: Users should be notified when their task list becomes stale due to new task assignments and the frontend should refresh the task list automatically or prompt a refresh.
Suggested Solution: Introduce a real-time event (WebSocket/SSE/push notification) such as TASKS_UPDATED or TASK_ASSIGNED. When a task is assigned, the backend emits the event to the affected user. Upon receiving the event, the frontend invalidates the cached task list and re-fetches the tasks.
Summary:
When a user has already loaded their task list, any tasks assigned afterward are not reflected in the UI because the task list remains cached. The user only sees the new tasks after a full session refresh (e.g., logout/login).
Add a real-time notification mechanism so that task assignment events trigger cache invalidation and a task list re-fetch on the client.
Issue: If a new task is assigned to a user after they have already loaded their task list, the frontend continues showing the cached task list and does not become aware of the newly assigned task. The user only sees the new task after a logout/login cycle (or another action that forces a refresh).
Expected Behavior: Users should be notified when their task list becomes stale due to new task assignments and the frontend should refresh the task list automatically or prompt a refresh.
Suggested Solution: Introduce a real-time event (WebSocket/SSE/push notification) such as TASKS_UPDATED or TASK_ASSIGNED. When a task is assigned, the backend emits the event to the affected user. Upon receiving the event, the frontend invalidates the cached task list and re-fetches the tasks.