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

Check geolocation quota at trip end #1125

Merged
merged 3 commits into from
Jan 16, 2024

Conversation

zatteo
Copy link
Contributor

@zatteo zatteo commented Jan 15, 2024

What do you think about this event implementation @Ldoppea and @paultranvan.

It means that we must install "events" package on CozyGPSMemory but that's all.

@zatteo zatteo requested a review from paultranvan January 15, 2024 12:09
Copy link
Contributor

@paultranvan paultranvan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some small remarks, but looks good overall

Geolocation quota is currently only checked at startup. So if the user keep the app in background for a long time, he will be able to use geolocation for a long time even if he should not use it anymore.

We try to keep a strong isolation in the geolocation tracking service because it is used by cozy-flagship-app and CozyGPSMemory.
To be able to listen to trip end events from the geolocation service, so from the heart of CozyGPSMemory, we add an event emitter.

This event emitter will emit a trip end, which can be listened to by cozy-flagship-app.
**About the expected behavior**

We want to do this request until we have a timeserie. As soon as we have a timeserie, we do not need anymore to do this request.

I think this behavior is not possible to model in cozy-client.

So I do the request as long as the result is [], and then when there is a timeserie, I store the timeserie in AsyncStorage. And if there is a timeserie in AsyncStorage, I don't do the request.

**About this commit**

With the cozy-client store and 24 hours cache as before this commit, I could store [] in the cache which is NOT what I want.
@zatteo zatteo force-pushed the fix/check-geolocation-quota-at-trip-end branch from ee880b7 to f056032 Compare January 16, 2024 12:44
@zatteo zatteo merged commit 7796c63 into master Jan 16, 2024
1 check passed
@zatteo zatteo deleted the fix/check-geolocation-quota-at-trip-end branch January 16, 2024 13:08
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

Successfully merging this pull request may close these issues.

2 participants