tijlleenders / ZinZen

Better together - an app to realize dreams together.
https://ZinZen.me
GNU Affero General Public License v3.0
41 stars 55 forks source link

Show toast when running scheduler for first time. #1816

Open tijlleenders opened 7 months ago

tijlleenders commented 7 months ago

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

  1. Start calculating async on the choose language page already. By the time you get to mytime the result is ready. Possible? More complicated?
  2. Precache the default schedule with the app - skipping the first calculation alltogether.

Additional context None.

tijlleenders commented 7 months ago

@Tushar-4781 Can you advise if one of the alternatives is better?

Tushar-4781 commented 7 months ago

@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.

tijlleenders commented 7 months ago

@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.

tijlleenders commented 4 months ago

@Tushar-4781 bump

Tushar-4781 commented 4 months ago

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.

tijlleenders commented 1 month ago

Removing @Tushar-4781 as this seems to be a forgotten issue - that someone else can pick up.