mealie-recipes / mealie

Mealie is a self hosted recipe manager and meal planner with a RestAPI backend and a reactive frontend application built in Vue for a pleasant user experience for the whole family. Easily add recipes into your database by providing the url and mealie will automatically import the relevant data or add a family recipe with the UI editor
https://docs.mealie.io
GNU Affero General Public License v3.0
5.74k stars 624 forks source link

[BUG] - Offline detection of shopping list is broken #3859

Open MoritzWeber0 opened 2 weeks ago

MoritzWeber0 commented 2 weeks ago

First Check

What is the issue you are experiencing?

When accessing the Shopping list on a Android device (in my case Xiaomi 13t) and then switch to offline mode (turn off Wifi and mobile data), it doesn't recognize it properly. The offline message is only displayed for an short time after a request was initiated. It resets directly to the previous value before the change. I can reproduce it on Firefox and Chrome for Android.

Screen recording:

https://github.com/mealie-recipes/mealie/assets/23395732/5b0c2def-3bd9-46e8-b2ba-a8efef3828c4

I can not reproduce it when using the desktop version (Linux). If I set the throttling to "Offline", then it all works fine.

Steps to Reproduce

  1. Open the Shopping List
  2. Turn off Wifi and mobile data or turn on flight mode
  3. It's not possible to modify list items as described above.

Please provide relevant logs

Console log: demo.mealie.io-1720262329786.log

Looks like the service worker caches the requests. In offline mode the requests still return 200 OK (from service worker). Screenshot from Network tab:

image

Zipped HAR file (you can extract it and then import the HAR file in the network tab of Chrome): demo.mealie.io.zip

Might be related to https://github.com/mealie-recipes/mealie/issues/3842.

Mealie Version

v1.10.2, can also be reproduced with the demo version.

Deployment

Docker (Linux)

Additional Deployment Details

No response

michael-genson commented 2 weeks ago

Should be fixed by https://github.com/mealie-recipes/mealie/pull/3837

boc-the-git commented 1 week ago

Marking as confirmed, based on Michael's comment