flutterfire icon indicating copy to clipboard operation
flutterfire copied to clipboard

🐛 [firebase_database] DatabaseReferenceWeb uses implements instead of extends; makes DatabaseReferencePlatform fragile

Open collinjackson opened this issue 4 years ago • 1 comments

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:

  1. Add a method to DatabaseReferencePlatform (a "minor" update).
  2. Compile error in DatabaseReferenceWeb because the method is not implemented.

Expected behavior

The implementation of Query should call verifyToken on the instance.

See also #8095.

collinjackson avatar Feb 16 '22 15:02 collinjackson

Similar / related: https://github.com/FirebaseExtended/flutterfire/issues/8095

darshankawar avatar Feb 17 '22 10:02 darshankawar