Skip to content
This repository was archived by the owner on Feb 22, 2023. It is now read-only.

Commit 89b1453

Browse files
axel-opcollinjackson
authored andcommitted
[firebase_performance] Fix invokeMethod formatting that caused a bug with Dart code obfuscation (#1874)
* Fix invokeMethod formatting that caused a bug with Dart code obfuscation
1 parent 80e21e0 commit 89b1453

File tree

6 files changed

+23
-19
lines changed

6 files changed

+23
-19
lines changed

packages/firebase_performance/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 0.3.0+3
2+
3+
* Fix bug that caused `invokeMethod` to fail with Dart code obfuscation
4+
15
## 0.3.0+2
26

37
* Fix bug preventing this plugin from working with hot restart.

packages/firebase_performance/lib/src/firebase_performance.dart

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ class FirebasePerformance {
3737
/// does not reflect whether instrumentation is enabled/disabled.
3838
Future<bool> isPerformanceCollectionEnabled() {
3939
return channel.invokeMethod<bool>(
40-
'$FirebasePerformance#isPerformanceCollectionEnabled',
40+
'FirebasePerformance#isPerformanceCollectionEnabled',
4141
<String, dynamic>{'handle': _handle},
4242
);
4343
}
@@ -48,7 +48,7 @@ class FirebasePerformance {
4848
/// application. By default, performance monitoring is enabled.
4949
Future<void> setPerformanceCollectionEnabled(bool enable) {
5050
return channel.invokeMethod<void>(
51-
'$FirebasePerformance#setPerformanceCollectionEnabled',
51+
'FirebasePerformance#setPerformanceCollectionEnabled',
5252
<String, dynamic>{'handle': _handle, 'enable': enable},
5353
);
5454
}
@@ -62,7 +62,7 @@ class FirebasePerformance {
6262
final int handle = _nextHandle++;
6363

6464
FirebasePerformance.channel.invokeMethod<void>(
65-
'$FirebasePerformance#newTrace',
65+
'FirebasePerformance#newTrace',
6666
<String, dynamic>{'handle': _handle, 'traceHandle': handle, 'name': name},
6767
);
6868

@@ -74,7 +74,7 @@ class FirebasePerformance {
7474
final int handle = _nextHandle++;
7575

7676
FirebasePerformance.channel.invokeMethod<void>(
77-
'$FirebasePerformance#newHttpMetric',
77+
'FirebasePerformance#newHttpMetric',
7878
<String, dynamic>{
7979
'handle': _handle,
8080
'httpMetricHandle': handle,

packages/firebase_performance/lib/src/http_metric.dart

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ class HttpMetric extends PerformanceAttributes {
5959

6060
_httpResponseCode = httpResponseCode;
6161
FirebasePerformance.channel.invokeMethod<void>(
62-
'$HttpMetric#httpResponseCode',
62+
'HttpMetric#httpResponseCode',
6363
<String, dynamic>{
6464
'handle': _handle,
6565
'httpResponseCode': httpResponseCode,
@@ -76,7 +76,7 @@ class HttpMetric extends PerformanceAttributes {
7676

7777
_requestPayloadSize = requestPayloadSize;
7878
FirebasePerformance.channel.invokeMethod<void>(
79-
'$HttpMetric#requestPayloadSize',
79+
'HttpMetric#requestPayloadSize',
8080
<String, dynamic>{
8181
'handle': _handle,
8282
'requestPayloadSize': requestPayloadSize,
@@ -93,7 +93,7 @@ class HttpMetric extends PerformanceAttributes {
9393

9494
_responseContentType = responseContentType;
9595
FirebasePerformance.channel.invokeMethod<void>(
96-
'$HttpMetric#responseContentType',
96+
'HttpMetric#responseContentType',
9797
<String, dynamic>{
9898
'handle': _handle,
9999
'responseContentType': responseContentType,
@@ -110,7 +110,7 @@ class HttpMetric extends PerformanceAttributes {
110110

111111
_responsePayloadSize = responsePayloadSize;
112112
FirebasePerformance.channel.invokeMethod<void>(
113-
'$HttpMetric#responsePayloadSize',
113+
'HttpMetric#responsePayloadSize',
114114
<String, dynamic>{
115115
'handle': _handle,
116116
'responsePayloadSize': responsePayloadSize,
@@ -129,7 +129,7 @@ class HttpMetric extends PerformanceAttributes {
129129

130130
_hasStarted = true;
131131
return FirebasePerformance.channel.invokeMethod<void>(
132-
'$HttpMetric#start',
132+
'HttpMetric#start',
133133
<String, dynamic>{'handle': _handle},
134134
);
135135
}
@@ -147,7 +147,7 @@ class HttpMetric extends PerformanceAttributes {
147147

148148
_hasStopped = true;
149149
return FirebasePerformance.channel.invokeMethod<void>(
150-
'$HttpMetric#stop',
150+
'HttpMetric#stop',
151151
<String, dynamic>{'handle': _handle},
152152
);
153153
}

packages/firebase_performance/lib/src/performance_attributes.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ abstract class PerformanceAttributes {
4848

4949
_attributes[name] = value;
5050
return FirebasePerformance.channel.invokeMethod<void>(
51-
'$PerformanceAttributes#putAttribute',
51+
'PerformanceAttributes#putAttribute',
5252
<String, dynamic>{
5353
'handle': _handle,
5454
'name': name,
@@ -66,7 +66,7 @@ abstract class PerformanceAttributes {
6666

6767
_attributes.remove(name);
6868
return FirebasePerformance.channel.invokeMethod<void>(
69-
'$PerformanceAttributes#removeAttribute',
69+
'PerformanceAttributes#removeAttribute',
7070
<String, dynamic>{'handle': _handle, 'name': name},
7171
);
7272
}
@@ -85,7 +85,7 @@ abstract class PerformanceAttributes {
8585
}
8686

8787
return FirebasePerformance.channel.invokeMapMethod<String, String>(
88-
'$PerformanceAttributes#getAttributes',
88+
'PerformanceAttributes#getAttributes',
8989
<String, dynamic>{'handle': _handle},
9090
);
9191
}

packages/firebase_performance/lib/src/trace.dart

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ class Trace extends PerformanceAttributes {
5252

5353
_hasStarted = true;
5454
return FirebasePerformance.channel.invokeMethod<void>(
55-
'$Trace#start',
55+
'Trace#start',
5656
<String, dynamic>{'handle': _handle},
5757
);
5858
}
@@ -70,7 +70,7 @@ class Trace extends PerformanceAttributes {
7070

7171
_hasStopped = true;
7272
return FirebasePerformance.channel.invokeMethod<void>(
73-
'$Trace#stop',
73+
'Trace#stop',
7474
<String, dynamic>{'handle': _handle},
7575
);
7676
}
@@ -88,7 +88,7 @@ class Trace extends PerformanceAttributes {
8888
_metrics.putIfAbsent(name, () => 0);
8989
_metrics[name] += value;
9090
return FirebasePerformance.channel.invokeMethod<void>(
91-
'$Trace#incrementMetric',
91+
'Trace#incrementMetric',
9292
<String, dynamic>{'handle': _handle, 'name': name, 'value': value},
9393
);
9494
}
@@ -103,7 +103,7 @@ class Trace extends PerformanceAttributes {
103103

104104
_metrics[name] = value;
105105
return FirebasePerformance.channel.invokeMethod<void>(
106-
'$Trace#setMetric',
106+
'Trace#setMetric',
107107
<String, dynamic>{'handle': _handle, 'name': name, 'value': value},
108108
);
109109
}
@@ -116,7 +116,7 @@ class Trace extends PerformanceAttributes {
116116
if (_hasStopped) return Future<int>.value(_metrics[name] ?? 0);
117117

118118
return FirebasePerformance.channel.invokeMethod<int>(
119-
'$Trace#getMetric',
119+
'Trace#getMetric',
120120
<String, dynamic>{'handle': _handle, 'name': name},
121121
);
122122
}

packages/firebase_performance/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ description: Flutter plugin for Google Performance Monitoring for Firebase, an a
44
iOS.
55
author: Flutter Team <[email protected]>
66
homepage: https://github.com/flutter/plugins/tree/master/packages/firebase_performance
7-
version: 0.3.0+2
7+
version: 0.3.0+3
88

99
dependencies:
1010
flutter:

0 commit comments

Comments
 (0)