Skip to content

GitAuto: makeBrowserOfflineTransport no longer adds types to transportOptions #12

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

gitauto-ai[bot]
Copy link

@gitauto-ai gitauto-ai bot commented Oct 5, 2024

Resolves #3

Based on the issue description, it seems like there is a bug related to TypeScript type definitions for transportOptions in the makeBrowserOfflineTransport function. Here's the pull request body for addressing this issue:

"""

Why the bug occurs

The bug occurs because the transportOptions provided to makeBrowserOfflineTransport are not correctly typed, leading to a TypeScript error when using options like flushAtStartup. The type Partial<BrowserTransportOptions> does not include the flushAtStartup property, which is causing the TypeScript validation to fail.

How to reproduce

  1. Upgrade the Sentry SDK to version 8.33.1 from 7.60.0.
  2. Use the makeBrowserOfflineTransport function with transportOptions that include flushAtStartup.
  3. Observe the TypeScript error: Object literal may only specify known properties, and 'flushAtStartup' does not exist in type 'Partial<BrowserTransportOptions>'.

How to fix

To fix this issue, we need to update the type definitions for transportOptions in the makeBrowserOfflineTransport function to include the flushAtStartup property. This can be done by extending the BrowserTransportOptions type to include any additional properties that are valid for offline transport options. This will ensure that TypeScript correctly recognizes flushAtStartup as a valid option, eliminating the error.

Test these changes locally

git checkout -b gitauto/issue-#3-8fe64f2e-cfee-4316-a0bd-2ae96b7dcd25
git pull origin gitauto/issue-#3-8fe64f2e-cfee-4316-a0bd-2ae96b7dcd25

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

makeBrowserOfflineTransport no longer adds types to transportOptions
0 participants