Skip to content

Location out of sync with location on iOS Find App #23

Closed

Description

@satmandu

This may be a duplicate of #9

I can see the current location in the Find My app on iOS, but the location is out of date in the OpenTagViewer (v1.0.4) app.

OpenTagViewer shows "Last Updated 3 hours ago."

(Which may be when OpenTagViewer was last able to get location data... but iOS is able to see more recent location data.)

I'm using a self-hosted anisette server which I've confirmed is up.

Logs show:

No need to update geocoding for beaconId=<...> because previous geocoding is still valid (location has not updated since the last check.)

Activity

  1. wanderdev0 commented on Jul 23, 2025

    @wanderdev0
    Owner

    Off the top of my head I think it might be quite likely related to malmeloo/FindMy.py#90 indeed

    I read somewhere that re-pairing the tags again can help the issue (resets some timers/makes them behave in the way that the FindMy library expects them to), until @malmeloo manages to get around to trying to implement a fix for this

  2. satmandu commented on Jul 23, 2025

    @satmandu
    Author

    Would logs be useful?

  3. wanderdev0 commented on Jul 23, 2025

    @wanderdev0
    Owner

    If you see anything in there that might be suspect you can absolutely share those here!

    The main thing I am concerned with on my end is generally whether I am messing up any of the fetch/merge logic of the location data in some way on top of any bugs coming from FindMy.py.

    I think the best way to compare that is probably to just make a utility script available that will do a no-nonsense no-merging latest data fetch that we could compare the reported app behaviour (logs) to. Essentially based on this FindMy.py/examples/real_airtag.py example.

    But as for right now I suppose I don't have the most informative debug tooling setup, and it's a bit of a "best effort guess at trying to locate any oddities". 😅

    EDIT: the main annoyance is that we can't trust the data from my upstream library to be correct or to match what Apple has from their own internal libraries (which are more correct than ours as they are not subject to breaking due to timer drift). So it's basically a game of trying to distinguish the source of the entropy.

  4. satmandu commented on Jul 23, 2025

    @satmandu
    Author
  5. malmeloo commented on Jul 23, 2025

    @malmeloo

    FYI, my intent is to look into the issue more thoroughly this week and hopefully release a fix very soon after that. I already have a good idea of what the fix would need to look like. Will let you know once it's out.

  6. wanderdev0 commented on Jul 24, 2025

    @wanderdev0
    Owner

    From my side I will try to extract this location data lookup/merge history logic and implement some proper unit tests for it, to at least validate the implementation at that level.

    I don't have enough time to set it up as I would with a corporate repo, but I imagine this is the main source of possible annoyance in my project

  7. wanderdev0 commented on Jul 24, 2025

    @wanderdev0
    Owner

    Yeah so @satmandu taking a look at your logs:


    OpenTagViewer-1753304281577.log.txt

    This one seems to say that:

    One possible issue I can see of the top of my head is if the app wasn't running in some time range and the location update rate is infrequent, then you could end up missing some datapoints.

    I think we could make it be better about this "missed data due to not running"-issue by increasing the range of time it can go back to fetch the reports, however the intention with setting it to 1 hr back for the main refresh loop was to avoid hammering the Apple API and getting anybody's account flagged in some way.

    The reason I took a large block like 1hr that is being refreshed every minute or so is that location data is added to the DB with a delay, so location data seems like it can get backfilled even if you already technically fetched data to cover that time before.

    One idea I have is to maybe initially (app launch) force a big block of time to be fetched (like 24 or 48 hours), merge that as needed and then continue with the small time range fetches... 🤔 (I don't remember if I do that already or not).

    (An interesting and weird note that I haven't gotten around to making smoother is that if you go to the tag's history and fetch the history per day, it will backfill the report DB for all those days. Then if you close and re-open the app, it will restore the latest report from DB if it didn't get anything fresher from the library/API. So that way you can get it to recognise newer "old" reports that it wouldn't fetch under normal circumstances. But yeah, I should ideally make that behaviour work when you don't restart the app, and improve the main UI behaviour separately...)


    OpenTagViewer-1753279751915.log.txt

    This one is more interesting.

    So we have that same "fetch last 1hr" pattern at the top and the same situation of returning 0 new results hence the merge etc being valid (no location update needed). But then the second call seems to fail.

    Log stuff in here (to not spam the thread)
    07-23 10:08:30.420  9349 10842 I python.stdout: num_items is 1
    07-23 10:08:30.420  9349 10842 I python.stdout: Fetching report for xxxxxx for the last 1 hours...
    07-23 10:08:38.543  9349 10842 I python.stdout: Failed to fetch all reports due to error: Traceback (most recent call last):
    07-23 10:08:38.544  9349 10842 I python.stdout:   File "/data/data/dev.wander.android.opentagviewer/files/chaquopy/AssetFinder/requirements/aiohttp/connector.py", line 1317, in _create_direct_connection
    07-23 10:08:38.544  9349 10842 I python.stdout:   File "/data/data/dev.wander.android.opentagviewer/files/chaquopy/AssetFinder/requirements/aiohttp/connector.py", line 971, in _resolve_host
    07-23 10:08:38.544  9349 10842 I python.stdout:   File "/data/data/dev.wander.android.opentagviewer/files/chaquopy/AssetFinder/requirements/aiohttp/connector.py", line 1002, in _resolve_host_with_throttle
    07-23 10:08:38.544  9349 10842 I python.stdout:   File "/data/data/dev.wander.android.opentagviewer/files/chaquopy/AssetFinder/requirements/aiohttp/resolver.py", line 38, in resolve
    07-23 10:08:38.544  9349 10842 I python.stdout:   File "stdlib/asyncio/base_events.py", line 901, in getaddrinfo
    07-23 10:08:38.544  9349 10842 I python.stdout:   File "stdlib/concurrent/futures/thread.py", line 58, in run
    07-23 10:08:38.544  9349 10842 I python.stdout:   File "stdlib/socket.py", line 976, in getaddrinfo
    07-23 10:08:38.544  9349 10842 I python.stdout: socket.gaierror: [Errno 7] No address associated with hostname
    07-23 10:08:38.544  9349 10842 I python.stdout: 
    07-23 10:08:38.545  9349 10842 I python.stdout: The above exception was the direct cause of the following exception:
    07-23 10:08:38.545  9349 10842 I python.stdout: 
    07-23 10:08:38.545  9349 10842 I python.stdout: Traceback (most recent call last):
    07-23 10:08:38.545  9349 10842 I python.stdout:   File "/data/data/dev.wander.android.opentagviewer/files/chaquopy/AssetFinder/app/main.py", line 220, in getLastReports
    07-23 10:08:38.545  9349 10842 I python.stdout:   File "/data/data/dev.wander.android.opentagviewer/files/chaquopy/AssetFinder/requirements/findmy/reports/account.py", line 1084, in fetch_last_reports
    07-23 10:08:38.545  9349 10842 I python.stdout:   File "stdlib/asyncio/base_events.py", line 687, in run_until_complete
    07-23 10:08:38.545  9349 10842 I python.stdout:   File "/data/data/dev.wander.android.opentagviewer/files/chaquopy/AssetFinder/requirements/findmy/reports/account.py", line 693, in fetch_last_reports
    07-23 10:08:38.545  9349 10842 I python.stdout:   File "/data/data/dev.wander.android.opentagviewer/files/chaquopy/AssetFinder/requirements/findmy/reports/account.py", line 655, in fetch_reports
    07-23 10:08:38.545  9349 10842 I python.stdout:   File "/data/data/dev.wander.android.opentagviewer/files/chaquopy/AssetFinder/requirements/findmy/reports/reports.py", line 299, in fetch_reports
    07-23 10:08:38.545  9349 10842 I python.stdout:   File "/data/data/dev.wander.android.opentagviewer/files/chaquopy/AssetFinder/requirements/findmy/reports/reports.py", line 327, in _fetch_reports
    07-23 10:08:38.546  9349 10842 I python.stdout:   File "/data/data/dev.wander.android.opentagviewer/files/chaquopy/AssetFinder/requirements/findmy/reports/account.py", line 594, in fetch_raw_reports
    07-23 10:08:38.546  9349 10842 I python.stdout:   File "/data/data/dev.wander.android.opentagviewer/files/chaquopy/AssetFinder/requirements/findmy/reports/account.py", line 590, in _do_request
    07-23 10:08:38.546  9349 10842 I python.stdout:   File "/data/data/dev.wander.android.opentagviewer/files/chaquopy/AssetFinder/requirements/findmy/reports/account.py", line 903, in get_anisette_headers
    07-23 10:08:38.546  9349 10842 I python.stdout:   File "/data/data/dev.wander.android.opentagviewer/files/chaquopy/AssetFinder/requirements/findmy/reports/anisette.py", line 208, in get_headers
    07-23 10:08:38.546  9349 10842 I python.stdout:   File "/data/data/dev.wander.android.opentagviewer/files/chaquopy/AssetFinder/requirements/findmy/util/http.py", line 121, in get
    07-23 10:08:38.546  9349 10842 I python.stdout:   File "/data/data/dev.wander.android.opentagviewer/files/chaquopy/AssetFinder/requirements/findmy/util/http.py", line 111, in request
    07-23 10:08:38.546  9349 10842 I python.stdout:   File "/data/data/dev.wander.android.opentagviewer/files/chaquopy/AssetFinder/requirements/aiohttp/client.py", line 663, in _request
    07-23 10:08:38.546  9349 10842 I python.stdout:   File "/data/data/dev.wander.android.opentagviewer/files/chaquopy/AssetFinder/requirements/aiohttp/connector.py", line 563, in connect
    07-23 10:08:38.546  9349 10842 I python.stdout:   File "/data/data/dev.wander.android.opentagviewer/files/chaquopy/AssetFinder/requirements/aiohttp/connector.py", line 1032, in _create_connection
    07-23 10:08:38.546  9349 10842 I python.stdout:   File "/data/data/dev.wander.android.opentagviewer/files/chaquopy/AssetFinder/requirements/aiohttp/connector.py", line 1323, in _create_direct_connection
    07-23 10:08:38.551  9349 10842 I python.stdout: aiohttp.client_exceptions.ClientConnectorDNSError: Cannot connect to host anisette.xxx.xxx:443 ssl:False [No address associated with hostname]
    07-23 10:08:38.551  9349 10842 I python.stdout: 
    07-23 10:08:38.551  9349 10842 E PythonAppleService: python call to getLastReports resulted in error (check python logs for details)
    07-23 10:08:38.558  9349  9349 E MapsActivity: Failed to refresh current locations!
    07-23 10:08:38.558  9349  9349 E MapsActivity: dev.wander.android.opentagviewer.python.PythonAppleFindMyException: Error while retrieving last reports for account via python!
    07-23 10:08:38.558  9349  9349 E MapsActivity: 	at dev.wander.android.opentagviewer.python.PythonAppleService.lambda$getLastReports$1$dev-wander-android-opentagviewer-python-PythonAppleService(PythonAppleService.java:68)
    07-23 10:08:38.558  9349  9349 E MapsActivity: 	at dev.wander.android.opentagviewer.python.PythonAppleService$$ExternalSyntheticLambda1.call(D8$$SyntheticClass:0)
    07-23 10:08:38.558  9349  9349 E MapsActivity: 	at io.reactivex.rxjava3.internal.operators.observable.ObservableFromCallable.subscribeActual(ObservableFromCallable.java:46)
    07-23 10:08:38.558  9349  9349 E MapsActivity: 	at io.reactivex.rxjava3.core.Observable.subscribe(Observable.java:13262)
    07-23 10:08:38.558  9349  9349 E MapsActivity: 	at io.reactivex.rxjava3.internal.operators.observable.ObservableSubscribeOn$SubscribeTask.run(ObservableSubscribeOn.java:96)
    07-23 10:08:38.558  9349  9349 E MapsActivity: 	at io.reactivex.rxjava3.core.Scheduler$DisposeTask.run(Scheduler.java:644)
    07-23 10:08:38.558  9349  9349 E MapsActivity: 	at io.reactivex.rxjava3.internal.schedulers.ScheduledRunnable.run(ScheduledRunnable.java:65)
    07-23 10:08:38.558  9349  9349 E MapsActivity: 	at io.reactivex.rxjava3.internal.schedulers.ScheduledRunnable.call(ScheduledRunnable.java:56)
    07-23 10:08:38.558  9349  9349 E MapsActivity: 	at java.util.concurrent.FutureTask.run(FutureTask.java:317)
    07-23 10:08:38.558  9349  9349 E MapsActivity: 	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:348)
    07-23 10:08:38.558  9349  9349 E MapsActivity: 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1156)
    07-23 10:08:38.558  9349  9349 E MapsActivity: 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:651)
    07-23 10:08:38.558  9349  9349 E MapsActivity: 	at java.lang.Thread.run(Thread.java:1119)
    

    It's failing at main.py:220, the root cause is this:

    aiohttp.client_exceptions.ClientConnectorDNSError: Cannot connect to host anisette.xxx.xxx:443 ssl:False [No address associated with hostname]
    

    No idea why the DNS resolution temporarily failed there. I'm curious if this is a frequent issue or just a random accident here?
    But I see that the next loop after that one succeeded while yet again fetching 0 new reports.

  8. satmandu commented on Jul 24, 2025

    @satmandu
    Author

    I use a CloudFlare SSL proxy, so maybe that's the issue? But the server resolves for me...

  9. satmandu commented on Jul 24, 2025

    @satmandu
    Author

    Also worth noting that I do get sporadic updates, the last one 8 hours ago, but the iOS devices do see more recent updates.

  10. wanderdev0 commented on Jul 25, 2025

    @wanderdev0
    Owner

    @satmandu
    So it might be worth checking how regularly that DNS resolution issue occurs but I suspect it's sporadic. And keep in mind it will redo the fetch every 1 min in the background, so it's quite likely that you're not being affected by it all that much if it only happens "every now and then". (And from your log we see that it seems to happen "every now and then" -- 3 good fetches from the PoV of a HTTP request succeeding versus one failing due to this DNS issue)

    Anyways, I think it would help if we waited for the fix from the FindMy.py library before pursuing your issue that much further, because that's a known entropy cause with regards to Location updates going missing.

  11. satmandu commented on Jul 25, 2025

    @satmandu
    Author

    I would note that I am still receiving sporadic updates, so perhaps the issue is only transient.

  12. added
    bug
    on Jul 29, 2025
  13. added
    @app
    🔴 BLOCKED: FindMy.py
    on Aug 6, 2025
  14. wanderdev0 commented on Sep 9, 2025

    @wanderdev0
    Owner

    This is now waiting on this to be implemented: This is now waiting on this to be implemented: #30

  15. removed
    🔴 BLOCKED: FindMy.py
    on Sep 9, 2025
  16. added this to the App version 1.1.0 milestone on Sep 23, 2025
  17. added
    fixed in app 1.1.0
    on Aug 23, 2026
  18. self-assigned this
    on Aug 25, 2026
  19. PermeationLoop commented on Aug 29, 2026

    @PermeationLoop

    Thank you for all the hard work!

    It would be great if the open tag viewer could read the lastest location like FindMy App. Looking forward to the release of the new version.

  20. wanderdev0 commented on Sep 16, 2026

    @wanderdev0
    Owner

    Hi, this should now be mostly fixed in the new 1.1.0 release, can you have a look? If it is ongoing in any new shape or form, please feel free to open a new bug issue.

  21. added theissue type on Nov 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

@appbugfixed in app 1.1.0

Type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions