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

Geofire query is run on old location path, even after initialising it with a new location path. #24

Open
prasundubey opened this issue Jun 20, 2021 · 5 comments

Comments

@prasundubey
Copy link

prasundubey commented Jun 20, 2021

Hi, I'm getting this issues while querying a new path in a session.

I have made 2 sites for storing the location of male & female separately. When a user wants to see only male in their location as per their initial selection, the query is run successfully and returns male in the given radius. But if the selection is changed to female, and Geofire is initialised to a new location path where female locations are stored..The query is still run on the pervious initialised location, and returns ids for male location rather than female.
Though the query return correct data on path initialised at first, either male or female.

Example code:

if(userInterest == male)
await Geofire.initialize(LocationBySex/male);
else if (userInterest == female)
await Geofire.initialize(LocationBySex/female);*/
try {
Geofire.queryAtLocation(location.latitude, location.longitude, dynamicRadius).listen((map) {....}

@gbrain2001
Copy link

Has anyone tried to fix this as I am having the same issue?

@marcusrohden
Copy link

hey guys, could you solve it? @prasundubey @gbrain2001 @mrdishant

@mrdishant
Copy link
Owner

Have you tried removing the listener and then initializing again?
bool response = await Geofire.stopListener();

@Laurin-G
Copy link

Hi @mrdishant, we're running into the same problem.
After using queryAtLocation().listen(), we canceled the StreamSubscription, called Geofire.stopListener() and ensured the correct execution order using a mutex before calling Geofire.initialize() again with a different path. However, any new queries will still run on the old path.

@slender2332
Copy link

same issue here. the listener keeps use the old location . we need this issue to be solved!

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

6 participants