Open tijlleenders opened 7 months ago
@Tushar-4781 Can you advise if one of the alternatives is better?
@tijlleenders we can experiment a server like approach here. we can setup a listener which capture the event whenever a goal collection has undergone a CRUD operation or any goal has undergone a CRUD operation and that fires the event and when you are on the goals page it calculate the schedule and store the exact response in DB ( which we are using like cache ) so everytime you do a change in goal collection it generates a schedule and when you go to my time you will be served the data. to make it more efficient we can use useMemo hook at higher level of app so that if u switch between pages the frontend doesn't make a call to db for the scheduler response it will only make call if you made a change in goals collection.
@Tushar-4781 I thought that was what we already had right? Cache the scheduler output unless there is a new day or goals have changed.
The question was more about the initial time someone loads the app. Then there is no cache yet and we have to wait a long time to see something.
@Tushar-4781 bump
the current implementation stores the output of the scheduler and serve it if there is no change in the goals. however when a new users comes they don't have anything in their goals neither in cache so the computation will take time. definitely we can make an attempt to move it behind the scenes. the schedule was not working when the discussion was happening. will work on it now.
Removing @Tushar-4781 as this seems to be a forgotten issue - that someone else can pick up.
Is your feature request related to a problem? Please describe. It's very annoying when you see an empty my time page for x seconds when you open the app for the first time.
Describe the solution you'd like Show a toast when there is no schedule jn cache: "Automagical scheduling of your goals in progress..."
Describe alternatives you've considered
Additional context None.