-
-
Notifications
You must be signed in to change notification settings - Fork 277
Closed
Description
Platform
Dart, Flutter Mobile Android
Obfuscation
Disabled
Debug Info
Disabled
Doctor
N/A (not an environment problem)
Version
9.6.0
Steps to Reproduce
- Following the official tutorial, I set up sqflite databaseFactory like this:
databaseFactory = SentrySqfliteDatabaseFactory();(without passing an argument to its inner databaseFactory property, which does prevent the issue as a workaround) - When I then run either openDatabase() or openDatabaseWithSentry(), the openDatabase method in SentrySqfliteDatabaseFactory is called (in file sentry_sqflite_database_factory.dart)
- At line 53, this code happens:
final databaseFactory = _databaseFactory ?? this;and since _databaseFactory is null, that local databaseFactory instance receives this - That causes unintended recursion at line 57, since the method now calls itself
Expected Result
If _databaseFactory is null (when SentrySqfliteDatabaseFactory's databaseFactory isn't set) , openDatabase() should fallback to the global default sqflite databaseFactory, not itself. There should be no risk of recursion or stack overflow.
Actual Result
When tracing is disabled and _databaseFactory is null, calling openDatabase may result in infinite recursion or a stack overflow, as the factory calls itself repeatedly.
Are you willing to submit a PR?
Yes
Metadata
Metadata
Assignees
Projects
Status
No status