Fix rolling accessory location history fetching - #252
Conversation
0408b0f to
f0e31e1
Compare
|
Hey, sorry for taking a while. I'm a bit hesitant to merge this, let me explain why. The FindMy API is really not built to obtain a full location history. Apple only stores a few reports per key and all reports expire after a short period of time. The old behavior of FindMy.py was to try to obtain the last location at all times. This worked for a while until they started limiting the API even further. The purpose of the Even if you set Also, either way, defaulting As an additional note, I'm not sure what the test is trying to accomplish here. Testing whether an internal method is called with a certain parameter does not seem very useful to me. |
Summary
fetch_location_history()fetch the full rolling key history by defaultfetch_location()on the faster latest-only path explicitlyWhy
LocationReportsFetcher.fetch_location_history()accepted aRollingKeyPairSource, but internally always passedonly_latest=Trueto_fetch_accessory_reports(). That meant callers asking for history could silently get only the newest report batch for rolling accessories.This keeps the public history method aligned with its name while preserving current-location performance through
fetch_location().Tests
.venv/bin/python -m pytest tests/test_reports.py tests/test_keygen.py.venv/bin/python -m ruff check findmy/reports/account.py findmy/reports/reports.py tests/test_reports.py