flutterfire
flutterfire copied to clipboard
🐛 [firebase_database] DatabaseReferenceWeb uses implements instead of extends; makes DatabaseReferencePlatform fragile
Bug report
Describe the bug
In firebase_database, QueryPlatform has a private static final Object _token = Object();. However, Query does not call verifyExtends. By constrast, the analogous class in Firestore does call verifyToken. Also, the other platform classes in this package call verifyToken.
As a result, DatabaseReferenceWeb is able to use implements instead of extends. This makes the platform interface fragile.
Steps to reproduce
Steps to reproduce the behavior:
- Add a method to
DatabaseReferencePlatform(a "minor" update). - Compile error in
DatabaseReferenceWebbecause the method is not implemented.
Expected behavior
The implementation of Query should call verifyToken on the instance.
See also #8095.
Similar / related: https://github.com/FirebaseExtended/flutterfire/issues/8095