[cloud_firestore]: Firestore Crash on Windows When Fetching Large Amounts of Data in Batches #17073
Open
1 task done
Labels
Needs Attention
This issue needs maintainer attention.
platform: windows
Issues / PRs which are specifically for Windows.
plugin: cloud_firestore
type: bug
Something isn't working
Is there an existing issue for this?
Which plugins are affected?
Other
Which platforms are affected?
Windows
Description
When retrieving a large number of Firestore documents in batches on Windows, the application crashes without any clear error message.
The same implementation works correctly on Android, but on Windows, the app suddenly closes during data retrieval.
✅ Expected Behavior
The application should not crash, and data retrieval should work as expected on Windows, just like on Android.
🚨 Observed Behavior
• The application suddenly closes on Windows without any error message in the console.
• This happens when fetching a large number of documents from Firestore (5000 documents).
• The issue occurs even when retrieving data in batches using limit(X) + startAfterDocument().
📌 Code Snippet
`// ignore_for_file: parameter_assignments';
import 'dart:io';
import 'package:cloud_firestore/cloud_firestore.dart';
import 'package:flutter/foundation.dart';
class RecupereParPaquetDocuments {
Future<List> excute({
required RecupereParPaquetDocumentsCommand command,
}) async {
DocumentSnapshot? lastDocument;
}
Future<DocumentSnapshot<Object?>?> getDocumentParPaquet(
RecupereParPaquetDocumentsCommand command,
DocumentSnapshot<Object?>? lastDocument,
List<T?> documents,
) async {
var query = command.queryCollectionReference.limit(command.paquetDeCombien);
if (lastDocument != null) {
query = query.startAfterDocument(lastDocument);
}
}
}
class RecupereParPaquetDocumentsCommand {
RecupereParPaquetDocumentsCommand({
required this.queryCollectionReference,
required this.paquetDeCombien,
});
final Query queryCollectionReference;
final int paquetDeCombien;
}
`
Reproducing the issue
Firebase Core version
3.0.0
Flutter Version
3.27.1
Relevant Log Output
Flutter dependencies
Expand
Flutter dependencies
snippetReplace this line with the contents of your `flutter pub deps -- --style=compact`.
Additional context and comments
No response
The text was updated successfully, but these errors were encountered: