@@ -88,7 +88,7 @@ async function collectBugReport(opts: IOpts = {}, gzipLogs = true): Promise<Form
88
88
keys . push ( `curve25519:${ client . getDeviceCurve25519Key ( ) } ` ) ;
89
89
}
90
90
body . append ( "device_keys" , keys . join ( ", " ) ) ;
91
- body . append ( "cross_signing_key" , client . getCrossSigningId ( ) ) ;
91
+ body . append ( "cross_signing_key" , client . getCrossSigningId ( ) ?? "n/a" ) ;
92
92
93
93
// add cross-signing status information
94
94
const crossSigning = client . crypto . crossSigningInfo ;
@@ -99,7 +99,7 @@ async function collectBugReport(opts: IOpts = {}, gzipLogs = true): Promise<Form
99
99
"cross_signing_supported_by_hs" ,
100
100
String ( await client . doesServerSupportUnstableFeature ( "org.matrix.e2e_cross_signing" ) ) ,
101
101
) ;
102
- body . append ( "cross_signing_key" , crossSigning . getId ( ) ) ;
102
+ body . append ( "cross_signing_key" , crossSigning . getId ( ) ?? "n/a" ) ;
103
103
body . append (
104
104
"cross_signing_privkey_in_secret_storage" ,
105
105
String ( ! ! ( await crossSigning . isStoredInSecretStorage ( secretStorage ) ) ) ,
@@ -108,15 +108,15 @@ async function collectBugReport(opts: IOpts = {}, gzipLogs = true): Promise<Form
108
108
const pkCache = client . getCrossSigningCacheCallbacks ( ) ;
109
109
body . append (
110
110
"cross_signing_master_privkey_cached" ,
111
- String ( ! ! ( pkCache && ( await pkCache . getCrossSigningKeyCache ( "master" ) ) ) ) ,
111
+ String ( ! ! ( pkCache && ( await pkCache ? .getCrossSigningKeyCache ?. ( "master" ) ) ) ) ,
112
112
) ;
113
113
body . append (
114
114
"cross_signing_self_signing_privkey_cached" ,
115
- String ( ! ! ( pkCache && ( await pkCache . getCrossSigningKeyCache ( "self_signing" ) ) ) ) ,
115
+ String ( ! ! ( pkCache && ( await pkCache ? .getCrossSigningKeyCache ?. ( "self_signing" ) ) ) ) ,
116
116
) ;
117
117
body . append (
118
118
"cross_signing_user_signing_privkey_cached" ,
119
- String ( ! ! ( pkCache && ( await pkCache . getCrossSigningKeyCache ( "user_signing" ) ) ) ) ,
119
+ String ( ! ! ( pkCache && ( await pkCache ? .getCrossSigningKeyCache ?. ( "user_signing" ) ) ) ) ,
120
120
) ;
121
121
122
122
body . append ( "secret_storage_ready" , String ( await client . isSecretStorageReady ( ) ) ) ;
@@ -163,14 +163,14 @@ async function collectBugReport(opts: IOpts = {}, gzipLogs = true): Promise<Form
163
163
body . append ( "storageManager_usage" , String ( estimate . usage ) ) ;
164
164
if ( estimate . usageDetails ) {
165
165
Object . keys ( estimate . usageDetails ) . forEach ( ( k ) => {
166
- body . append ( `storageManager_usage_${ k } ` , String ( estimate . usageDetails [ k ] ) ) ;
166
+ body . append ( `storageManager_usage_${ k } ` , String ( estimate . usageDetails ! [ k ] ) ) ;
167
167
} ) ;
168
168
}
169
169
} catch ( e ) { }
170
170
}
171
171
172
172
if ( window . Modernizr ) {
173
- const missingFeatures = Object . keys ( window . Modernizr ) . filter (
173
+ const missingFeatures = ( Object . keys ( window . Modernizr ) as [ keyof ModernizrStatic ] ) . filter (
174
174
( key : keyof ModernizrStatic ) => window . Modernizr [ key ] === false ,
175
175
) ;
176
176
if ( missingFeatures . length > 0 ) {
@@ -253,7 +253,7 @@ export async function downloadBugReport(opts: IOpts = {}): Promise<void> {
253
253
await new Promise < void > ( ( resolve ) => {
254
254
const reader = new FileReader ( ) ;
255
255
reader . addEventListener ( "loadend" , ( ev ) => {
256
- tape . append ( `log-${ i ++ } .log` , new TextDecoder ( ) . decode ( ev . target . result as ArrayBuffer ) ) ;
256
+ tape . append ( `log-${ i ++ } .log` , new TextDecoder ( ) . decode ( reader . result as ArrayBuffer ) ) ;
257
257
resolve ( ) ;
258
258
} ) ;
259
259
reader . readAsArrayBuffer ( value as Blob ) ;
@@ -302,14 +302,18 @@ export async function submitFeedback(
302
302
303
303
body . append ( "app" , "element-web" ) ;
304
304
body . append ( "version" , version || "UNKNOWN" ) ;
305
- body . append ( "platform" , PlatformPeg . get ( ) . getHumanReadableName ( ) ) ;
306
- body . append ( "user_id" , MatrixClientPeg . get ( ) ?. getUserId ( ) ) ;
305
+ body . append ( "platform" , PlatformPeg . get ( ) ? .getHumanReadableName ( ) ?? "n/a" ) ;
306
+ body . append ( "user_id" , MatrixClientPeg . get ( ) ?. getUserId ( ) ?? "n/a" ) ;
307
307
308
308
for ( const k in extraData ) {
309
309
body . append ( k , JSON . stringify ( extraData [ k ] ) ) ;
310
310
}
311
311
312
- await submitReport ( SdkConfig . get ( ) . bug_report_endpoint_url , body , ( ) => { } ) ;
312
+ const bugReportEndpointUrl = SdkConfig . get ( ) . bug_report_endpoint_url ;
313
+
314
+ if ( bugReportEndpointUrl ) {
315
+ await submitReport ( bugReportEndpointUrl , body , ( ) => { } ) ;
316
+ }
313
317
}
314
318
315
319
function submitReport ( endpoint : string , body : FormData , progressCallback : ( str : string ) => void ) : Promise < string > {
0 commit comments