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

cleanup(engine): do not expose LookupLocationContext #1537

Merged
merged 2 commits into from
Apr 3, 2024
Merged

Conversation

bassosimone
Copy link
Contributor

@bassosimone bassosimone commented Apr 3, 2024

Potentially, this code would cause a behavioral change in that once the probe location has been found, it would not change again and it might be a problem for very-long-running sessions.

However:

  1. the Android codebase does not keep a reference to a session for a very long time and anyway the longest-running sessions are those used for running experiments;

  2. the correct behavior would be for MaybeLookupLocationContext to cache the results only for a limited amount of time.

Because of all these considerations, it actually makes sense to say that replacing LookupLocationContext with MaybeLookupLocationContext and engine.Session accessors is the ~same.

The net benefit for us is that we can further reduce the surface of interaction between clients and the engine code. A simpler API surface is also simpler to document.

Part of ooni/probe#2700

We can obtain the ~same effect by using MaybeLookupLocationContext
and then using the corresponding Session accessors.

Potentially, this code would cause a behavioral change in that
once the probe location has been found, it would not change again
and it might be a problem for very-long-running sessions.

However:

1. the Android codebase does not keep a reference to a session
for a very long time and anyway the longest-running sessions are
those used for running experiments;

2. the correct behavior would be for MaybeLookupLocationContext
to cache the results only for a limited amount of time.

Because of all these considerations, it actually makes sense
to say that "we're obtaining the ~same effect".

The net benefit for us is that we can further reduce the surface
of interaction between clients and the engine code. A simpler
API surface is also simpler to document.

Part of ooni/probe#2700
@bassosimone bassosimone merged commit f9cb93e into master Apr 3, 2024
26 checks passed
@bassosimone bassosimone deleted the issue/2700 branch April 3, 2024 05:36
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.

1 participant