Repository: tauri
Issue: [bug] App running indefinetely gets "frozen" after certain time
Labels: type: bug,status: needs triage

### Describe the bug

I have written an application in Tauri, Rust + JS React. When the machine connected to the app stops working, the app sends to database equivalent of the injection but in other state like machine failure to indicate how many injections could have happened during the machine failure and look:

`
I, [2024-03-28T03:29:07.845214 #723418]  INFO -- : [373a6e4c-86cf-47d5-8e6a-ac31ce78d1bc]   Parameters: {"cycles"=>[{"injector"=>"ST 70", "state"=>3, "length"=>55, "current_time"=>"3:29:7", "current_date"=>"2024-3-28"}], "cycle"=>{"cycles"=>[{"injector"=>"ST 70", "state"=>3, "length"=>55, "current_time"=>"3:29:7", "current_date"=>"2024-3-28"}]}}
I, [2024-03-28T03:29:07.854491 #723418]  INFO -- : [373a6e4c-86cf-47d5-8e6a-ac31ce78d1bc] Completed 200 OK in 9ms (Views: 0.3ms | ActiveRecord: 0.0ms | Allocations: 2381)
`

This is last log from Rails that was send from my app to Rails server. This request sending is handled by Interval in JS that is fired each 55 seconds as you can see, the length is set to 55, and the request is made with axios library. Everything would be fine if not this - the next request from app came 43 minutes later, as if the app has fallen asleep:

`
I, [2024-03-28T04:13:40.365444 #723418]  INFO -- : [6dae3bff-6f3f-44c4-9961-0b8b2b41f7c2]   Parameters: {"cycles"=>[{"injector"=>"ST 70", "state"=>3, "length"=>55, "current_time"=>"3:30:2", "current_date"=>"2024-3-28"}], "cycle"=>{"cycles"=>[{"injector"=>"ST 70", "state"=>3, "length"=>55, "current_time"=>"3:30:2", "current_date"=>"2024-3-28"}]}}
I, [2024-03-28T04:13:40.360601 #723418]  INFO -- : [6e537b40-79c4-4cec-82f1-5b348731f892] Started POST "/cycles" for *** at 2024-03-28 04:13:40 +0100
I, [2024-03-28T04:13:40.369729 #723418]  INFO -- : [6e537b40-79c4-4cec-82f1-5b348731f892] Processing by CyclesController#create as HTML
I, [2024-03-28T04:13:40.369892 #723418]  INFO -- : [6e537b40-79c4-4cec-82f1-5b348731f892]   Parameters: {"cycles"=>[{"injector"=>"ST 70", "state"=>3, "length"=>55, "current_time"=>"3:31:52", "current_date"=>"2024-3-28"}], "cycle"=>{"cycles"=>[{"injector"=>"ST 70", "state"=>3, "length"=>55, "current_time"=>"3:31:52", "current_date"=>"2024-3-28"}]}}
I, [2024-03-28T04:13:40.365232 #723418]  INFO -- : [89cb0939-2fd8-48f7-b8e1-c8a7f3667771] Started POST "/cycles" for *** at 2024-03-28 04:13:40 +0100
I, [2024-03-28T04:13:40.371292 #723418]  INFO -- : [89cb0939-2fd8-48f7-b8e1-c8a7f3667771] Processing by CyclesController#create as HTML
I, [2024-03-28T04:13:40.374927 #723418]  INFO -- : [89cb0939-2fd8-48f7-b8e1-c8a7f3667771]   Parameters: {"cycles"=>[{"injector"=>"ST 70", "state"=>3, "length"=>55, "current_time"=>"3:32:47", "current_date"=>"2024-3-28"}], "cycle"=>{"cycles"=>[{"injector"=>"ST 70", "state"=>3, "length"=>55, "current_time"=>"3:32:47", "current_date"=>"2024-3-28"}]}}
`

The app sent all data that was generated during this "hung up" time at once - even though the request came 4:13, the request included data 43 minutes old, as you can see (current_time). And it was like the server was bombed with the data that appeared during this 43 minutes, like JS has realised that he has to send all data to the server. All axios request have been maintained in "cache?" somehow and when the app had woken up, it sent it all at once. The problem is JavaScript is single threaded, I'm aware of this, and in this case there is a lot stuff going on on main thread, but to be honest - I've seen app that handle much more and everything works completely fine. What happened guys? Need help. Is there any known issue JS getting frozen for a period of time?


### Reproduction

It's gonna be hard to reproduce cause app is huge. Essentially and the most important thing - app runs 24/7. There is no restarts or anything else, unless the PC's crash.

### Expected behavior

_No response_

### Full `tauri info` output

```text
[✔] Environment
    - OS: Windows 10.0.22631 X64
    ✔ WebView2: 122.0.2365.92
    ✔ MSVC: Visual Studio Community 2022
    ✔ rustc: 1.77.1 (7cf61ebde 2024-03-27)
    ✔ Cargo: 1.77.1 (e52e36006 2024-03-26)
    ✔ rustup: 1.27.0 (bbb9276d2 2024-03-08)
    ✔ Rust toolchain: stable-x86_64-pc-windows-msvc (default)
    - node: 18.14.1
    - npm: 9.6.0

[-] Packages
    - tauri [RUST]: 1.5.1
    - tauri-build [RUST]: 1.5.0
    - wry [RUST]: 0.24.4
    - tao [RUST]: 0.16.4
    - tauri-cli [RUST]: not installed!
    - @tauri-apps/api [NPM]: 1.5.0 (outdated, latest: 1.5.3)
    - @tauri-apps/cli [NPM]: 1.5.1 (outdated, latest: 1.5.11)

[-] App
    - build-type: bundle
    - CSP: unset
    - distDir: ../dist
    - devPath: http://localhost:1420/
    - framework: React
    - bundler: Vite
```


### Stack trace

```text
There is no stacktrace. I've been sleeping when it occurred. I guess, the whole app is responsive but it doesn't provide any data for database.
```


### Additional context

_No response_