Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Apple server does not honor time window #23

Closed
aircable opened this issue Apr 8, 2024 · 2 comments
Closed

Apple server does not honor time window #23

aircable opened this issue Apr 8, 2024 · 2 comments

Comments

@aircable
Copy link

aircable commented Apr 8, 2024

I'm trying to get data only for one day by setting startdate and enddate for the search.
This was the query. You see it's 24 hours.
{'search': [{'startDate': 1712449083967, 'endDate': 1712535483967, 'ids':...
But the Apple server always returns a week of data.
Is the format wrong?
Your code in accounts.py changed:

def fetch_last_reports(
        self,
        keys: Sequence[KeyPair],
        hours: int = 1 * 24,
    ) -> MaybeCoro[dict[KeyPair, list[LocationReport]]]:
@aircable aircable changed the title Apple server does not honer time window Apple server does not honor time window Apr 8, 2024
@malmeloo
Copy link
Owner

malmeloo commented Apr 8, 2024

This is a known issue, see biemster/FindMy#7 for more context.

I've briefly tried looking into this myself as well, but haven't figured out yet why it doesn't work. I think it might be an issue on Apple's side.

You can always manually filter the results if you wish, there's not a huge downside to fetching too many reports. I'd rather not do this in the library because throwing out a bunch of reports would be rather wasteful.

@aircable
Copy link
Author

aircable commented Apr 8, 2024

Thank you for the reference, I didn't find it.
I sort it myself and it's not a big deal.
You may close the issue. When @biemster finds the issue we can fix it too.

@malmeloo malmeloo closed this as completed Apr 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants