Skip to content

Commit e8c2a2b

Browse files
authored
fix(firebase_performance): fix the token verification. (#6912)
This issue causes the example app to throw the error "'Platform interfaces must not be implemented with `implements`'" from PlatformInterface.verifyToken function call when running on the web browser. It will also cause the web plugin unit test (coming in the next PR) to fail due to the same error.
1 parent 2287ba0 commit e8c2a2b

File tree

5 files changed

+14
-4
lines changed

5 files changed

+14
-4
lines changed

packages/firebase_performance/firebase_performance/README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,10 @@ To contribute a change to this plugin,
9393
please review our [contribution guide](https://github.com/FirebaseExtended/flutterfire/blob/master/CONTRIBUTING.md)
9494
and open a [pull request](https://github.com/FirebaseExtended/flutterfire/pulls).
9595

96+
### Testing
97+
98+
The unit test is in `test` directory which you can run using `flutter test`.
99+
96100
The integration test is in `example/test_driver/firebase_performance_e2e.dart` which you can run on an emulator:
97101
```
98102
cd example

packages/firebase_performance/firebase_performance/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ environment:
1414
dependencies:
1515
firebase_core: ^1.6.0
1616
firebase_core_platform_interface: ^4.0.1
17-
firebase_performance_platform_interface: ^0.0.1+1
17+
firebase_performance_platform_interface: ^0.0.1+2
1818
flutter:
1919
sdk: flutter
2020

packages/firebase_performance/firebase_performance_platform_interface/CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
## 0.0.1+2
2+
3+
**FIX**: fix the token verification (#6912).
4+
5+
16
## 0.0.1+1
27

38
- **REFACTOR**: create interface plugin that federates the main plugin (#6851).

packages/firebase_performance/firebase_performance_platform_interface/lib/src/platform_interface/platform_interface_firebase_performance.dart

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,10 @@ enum HttpMethod { Connect, Delete, Get, Head, Options, Patch, Post, Put, Trace }
2222
/// [FirebasePerformancePlatform] methods.
2323
abstract class FirebasePerformancePlatform extends PlatformInterface {
2424
/// Create an instance using [app].
25-
FirebasePerformancePlatform({this.appInstance}) : super(token: Object());
25+
FirebasePerformancePlatform({this.appInstance}) : super(token: _token);
2626

2727
static FirebasePerformancePlatform? _instance;
28+
static final Object _token = Object();
2829

2930
/// The current default [FirebasePerformancePlatform] instance.
3031
///
@@ -36,7 +37,7 @@ abstract class FirebasePerformancePlatform extends PlatformInterface {
3637

3738
/// Sets the [FirebasePerformancePlatform] instance.
3839
static set instance(FirebasePerformancePlatform instance) {
39-
PlatformInterface.verifyToken(instance, Object());
40+
PlatformInterface.verifyToken(instance, _token);
4041
_instance = instance;
4142
}
4243

packages/firebase_performance/firebase_performance_platform_interface/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: firebase_performance_platform_interface
22
description: A common platform interface for the firebase_performance plugin.
3-
version: 0.0.1+1
3+
version: 0.0.1+2
44
homepage: https://firebase.flutter.dev/docs/performance/overview
55

66
environment:

0 commit comments

Comments
 (0)