File tree Expand file tree Collapse file tree 2 files changed +10
-4
lines changed
glean/src/core/metrics/types Expand file tree Collapse file tree 2 files changed +10
-4
lines changed Original file line number Diff line number Diff line change 22
33[ Full changelog] ( https://github.com/mozilla/glean.js/compare/v2.0.1...main )
44
5+ * [ #1755 ] ( https://github.com/mozilla/glean.js/pull/1755 ) : Add sync check to ` set ` function for the URL metric.
6+
57# v2.0.1 (2023-08-11)
68
79[ Full changelog] ( https://github.com/mozilla/glean.js/compare/v2.0.0...v2.0.1 )
Original file line number Diff line number Diff line change @@ -90,6 +90,14 @@ class InternalUrlMetricType extends MetricType {
9090 }
9191
9292 /// SHARED ///
93+ set ( url : string ) : void {
94+ if ( Context . isPlatformSync ( ) ) {
95+ this . setSync ( url ) ;
96+ } else {
97+ this . setAsync ( url ) ;
98+ }
99+ }
100+
93101 setUrl ( url : URL ) : void {
94102 if ( Context . isPlatformSync ( ) ) {
95103 this . setSync ( url . toString ( ) ) ;
@@ -100,10 +108,6 @@ class InternalUrlMetricType extends MetricType {
100108
101109 /// ASYNC ///
102110 setAsync ( url : string ) {
103- this . set ( url ) ;
104- }
105-
106- set ( url : string ) : void {
107111 Context . dispatcher . launch ( async ( ) => {
108112 if ( ! this . shouldRecord ( Context . uploadEnabled ) ) {
109113 return ;
You can’t perform that action at this time.
0 commit comments