traccar / traccar-client-ios

Traccar Client for iOS
https://www.traccar.org/client
Apache License 2.0
218 stars 312 forks source link

Offline buffering does not buffer when server is offline #83

Open Voidthe opened 3 months ago

Voidthe commented 3 months ago

Describe the bug When using cloudflare and cloudflare tunnels to access traccar if the tunnel or server is down location data is not cached.

To Reproduce Steps to reproduce the behavior:

  1. Turn off cloudflare tunnel
  2. Observe client still sends updates but updates not reflected in traccar manager
  3. Turn on cloudflare tunnel
  4. Observe that the data is lost.

Expected behavior Location data is stored untill the server is back online and data is sync as normal.

Smartphone (please complete the following information):

Additional context I have a feeling its due to how traccar client checks if the server is online. I have a feeling that its only checking for normal failure codes like 4XX or 50X. When using cloudflare tunnel it will return a nonstandard error code of 530. It feels like it should only delete the data on a successful 2XX response

tananaev commented 3 months ago

https://github.com/traccar/traccar-client-ios/blob/master/TraccarClient/RequestManager.swift