pomatez
pomatez copied to clipboard
timer slower in background in tauri version
Describe the bug when choose tauri version, after hidden the main window, the clock become much slower then real time.
To Reproduce
- start the tauri version pomatez
- mark the time, close to tray
- after about 10 minutes
- open the main, compare time
Expected behavior time go as fast as system clock
Desktop (please complete the following information):
- OS: macIS Sinoma
- App Version: 1.6.4
- Installer Used: Pomatez-v1.6.4-mac-arm64.dmg
Additional context similar issue: https://github.com/zidoro/pomatez/issues/67 seem related issue: https://github.com/tauri-apps/tauri/issues/5250
I need to rework the timer code anyway to support a mobile version, Though currently the code has a timer triggering every 1 second. When the browser goes into the background it tends to slow the number of functions that can trigger in the background. I am assuming this is going above the 1 second hence slowing this down. I am not sure when I will have time to address this properly, though I can take a look at making it validate the time remaining based on a start time rather than time remaining.
@sekwah41 thanks for quick response! it sound like a good work
sorry for the wrong operate.
Making this a high priority now as it majorly causes an issue for the reliability
I added some additional logic and tested it now to sync the countdown with the timer as well as try to re-align the ticking interval to be as close to the second as possible so when it is maximised, it should re-align asap and avoid potentially skipping a second visually every now and then.
I not only minimised it in the background but also put the laptop to sleep for a few mins and it seems to be fine :D