kfiross/flutter_mongodb_realm

Using collection.watch() on flutter web : TypeError Cannot read properties of undefined (reading '_id')

Opened this issue · 1 comments

Hi, first, thank for amazing package. i am not sure this coming from the package, but i want to report just in case.

Using collection.watch() on flutter web throw an error : TypeError: Cannot read properties of undefined (reading '_id') .

how to reproduce:

  1. watch a collection in flutter web :

    Stream _watchProduct() {
        final collection = ref
            .read(clientProvider)
            .getDatabase(DBrepo.services)
            .getCollection(DBrepo.services_agent);
        return collection.watch();
      }
    
  2. listen to event :

    _subscription = _watchProduct().listen((event) { });

  3. delete a document in that collection:

screenshot

full log :

TypeError: Cannot read properties of undefined (reading '_id')
https://mkqerrzgldvzwtntkzhr.supabase.co/storage/v1/object/public/mati-apps/stitchUtils.js 435:41  <fn>
https://s3.amazonaws.com/stitch-sdks/js/bundles/4.9.0/stitch.js 1:157128                           onEvent
https://s3.amazonaws.com/stitch-sdks/js/bundles/4.9.0/stitch.js 1:199347                           poll
https://s3.amazonaws.com/stitch-sdks/js/bundles/4.9.0/stitch.js 1:223111                           onmessage

Same here (only for deletions)