Skip to content

Commit

Permalink
Fix build errors
Browse files Browse the repository at this point in the history
  • Loading branch information
timfish committed Jun 26, 2024
1 parent f5a0b94 commit 90be048
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 8 deletions.
1 change: 1 addition & 0 deletions src/main/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ export {
fastifyIntegration,
flush,
functionToStringIntegration,
generateInstrumentOnce,
getActiveSpan,
getAutoPerformanceIntegrations,
getClient,
Expand Down
4 changes: 2 additions & 2 deletions src/main/integrations/electron-minidump.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,8 @@ export const electronMinidumpIntegration = defineIntegration(() => {

// Update the extra parameters in the main process
const mainParams = getNativeUploaderExtraParams(event);
for (const key of Object.keys(mainParams)) {
crashReporter.addExtraParameter(key, mainParams[key]);
for (const [key, value] of Object.entries(mainParams)) {
crashReporter.addExtraParameter(key, value);
}
})
.catch((error) => logger.error(error));
Expand Down
14 changes: 8 additions & 6 deletions src/main/transports/electron-net.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@ export function createElectronNetRequestExecutor(

const req = net.request(getRequestOptions(url));

for (const header of Object.keys(headers)) {
req.setHeader(header, headers[header]);
for (const [header, value] of Object.entries(headers)) {
req.setHeader(header, value);
}

req.on('response', (res) => {
Expand All @@ -93,13 +93,15 @@ export function createElectronNetRequestExecutor(

// "Key-value pairs of header names and values. Header names are lower-cased."
// https://nodejs.org/api/http.html#http_message_headers
const retryAfterHeader = res.headers['retry-after'] ?? undefined;
const rateLimitsHeader = res.headers['x-sentry-rate-limits'] ?? undefined;
const retryAfterHeader = res.headers['retry-after'] ?? null;
const rateLimitsHeader = res.headers['x-sentry-rate-limits'] ?? null;

resolve({
headers: dropUndefinedKeys({
'retry-after': Array.isArray(retryAfterHeader) ? retryAfterHeader[0] : retryAfterHeader,
'x-sentry-rate-limits': Array.isArray(rateLimitsHeader) ? rateLimitsHeader[0] : rateLimitsHeader,
'retry-after': Array.isArray(retryAfterHeader) ? retryAfterHeader[0] || null : retryAfterHeader,
'x-sentry-rate-limits': Array.isArray(rateLimitsHeader)
? rateLimitsHeader[0] || null
: rateLimitsHeader,
}),
});
});
Expand Down
1 change: 1 addition & 0 deletions src/renderer/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ export {
startSession,
startSpan,
startSpanManual,
thirdPartyErrorFilterIntegration,
withActiveSpan,
withIsolationScope,
withScope,
Expand Down

0 comments on commit 90be048

Please sign in to comment.