DarshanGowda0 / GeoFlutterFire

:fire:GeoFlutterFire:fire: is an open-source library that allows you to store and query firestore documents based on their geographic location.
https://youtu.be/MYHVyl-juUk
MIT License
305 stars 261 forks source link

Duplicate data in the result #57

Open KasemJaffer opened 4 years ago

KasemJaffer commented 4 years ago

I am getting duplicate data result.

Here is my code:

// I only have one document in the database
GeoFlutterfire()
        .collection(
            collectionRef: Firestore.instance.collection('countries'))
        .within(
            center: GeoFirePoint(45.208794, -133.5497394),
            radius: 50000,
            field: "location",
            strictMode: true).listen((snapshots){
int count = snapshots.length; // snapshots has two items of the same document.
});
marvinsxtr commented 4 years ago

Interestingly, I found the same behavior for any radius value over 1250. Below this number, everything works fine for me.

Thibault2ss commented 4 years ago

Hey everyone, I had the same issue, I found the bug and fixed it. It was because of an edge case not handled by the lib, which created a duplicate query.

To fix it (until @DarshanGowda0 merges my fix) you can update your pubspec.yaml file to fetch my fixed branch:

geoflutterfire:
    git:
      url: git://github.com/Thibault2ss/GeoFlutterFire
      ref: fix-duplicate-results-on-large-radius

Cheers 👍

fly-qp commented 3 years ago

This issue still exists?! + Fix not compatible with the latest version of Firestore

lemohammed commented 2 years ago

Stil getting this

enqvida commented 2 years ago

Getting the same issue, please fix it its been 2 years :D

Gatos90 commented 1 year ago

Any chance of fixing this?