-
-
Notifications
You must be signed in to change notification settings - Fork 277
Send DSN with SentryEnvelopeHeader #873
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
Closed
Closed
Changes from 2 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
6a35dad
Move to local dependency
vishnukvmd 1ba4085
Pass DSN within the SentryEnvelopeHeader
vishnukvmd a6fb6c0
Switch to remote dependency as an override is already declared
vishnukvmd 152d32a
Merge branch 'main' into sentry_tunnel
ua741 3502ee4
Fix broken tests
ua741 bd69848
Fix test
ua741 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -28,7 +28,7 @@ void main() { | |
|
|
||
| final item = SentryEnvelopeItem(itemHeader, dataFactory); | ||
|
|
||
| final header = SentryEnvelopeHeader(eventId, null); | ||
| final header = SentryEnvelopeHeader(eventId, null, null); | ||
| final sut = SentryEnvelope(header, [item, item]); | ||
|
|
||
| final expectedHeaderJson = header.toJson(); | ||
|
|
@@ -53,7 +53,9 @@ void main() { | |
| final sentryEvent = SentryEvent(eventId: eventId); | ||
| final sdkVersion = | ||
| SdkVersion(name: 'fixture-name', version: 'fixture-version'); | ||
| final sut = SentryEnvelope.fromEvent(sentryEvent, sdkVersion); | ||
| final fakeDsn = 'https://[email protected]/1234567'; | ||
| final sut = | ||
| SentryEnvelope.fromEvent(sentryEvent, sdkVersion, fakeDsn); | ||
|
|
||
| final expectedEnvelopeItem = SentryEnvelopeItem.fromEvent(sentryEvent); | ||
|
|
||
|
|
@@ -111,16 +113,19 @@ void main() { | |
| final sentryEvent = SentryEvent(eventId: eventId); | ||
| final sdkVersion = | ||
| SdkVersion(name: 'fixture-name', version: 'fixture-version'); | ||
| final fakeDsn = 'https://[email protected]/1234567'; | ||
|
|
||
| final sut = SentryEnvelope.fromEvent( | ||
| sentryEvent, | ||
| sdkVersion, | ||
| fakeDsn, | ||
| attachments: [attachment], | ||
| ); | ||
|
|
||
| final expectedEnvelopeItem = SentryEnvelope.fromEvent( | ||
| sentryEvent, | ||
| sdkVersion, | ||
| fakeDsn, | ||
| ); | ||
|
|
||
| final sutEnvelopeData = <int>[]; | ||
|
|
@@ -140,12 +145,14 @@ void main() { | |
| // This is a test for https://github.com/getsentry/sentry-dart/issues/523 | ||
| test('serialize with non-serializable class', () async { | ||
| final event = SentryEvent(extra: {'non-ecodable': NonEncodable()}); | ||
| final fakeDsn = 'https://[email protected]/1234567'; | ||
| final sut = SentryEnvelope.fromEvent( | ||
| event, | ||
| SdkVersion( | ||
| name: 'test', | ||
| version: '1', | ||
| ), | ||
| fakeDsn, | ||
| ); | ||
|
|
||
| final _ = sut.envelopeStream(SentryOptions()).map((e) => e); | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -28,7 +28,7 @@ void main() { | |
|
|
||
| final eventId = SentryId.fromId('3b382f22ee67491f80f7dee18016a7b1'); | ||
| final sdkVersion = SdkVersion(name: 'test', version: 'version'); | ||
| final header = SentryEnvelopeHeader(eventId, sdkVersion); | ||
| final header = SentryEnvelopeHeader(eventId, sdkVersion, null); | ||
| final envelope = SentryEnvelope(header, [attachmentItem]); | ||
|
|
||
| final envelopeData = <int>[]; | ||
|
|
@@ -51,10 +51,12 @@ void main() { | |
| final sdkVersion = SdkVersion(name: '', version: ''); | ||
| final attachment = | ||
| IoSentryAttachment.fromPath('this_path_does_not_exist.txt'); | ||
| final fakeDsn = 'https://[email protected]/1234567'; | ||
|
|
||
| final envelope = SentryEnvelope.fromEvent( | ||
| event, | ||
| sdkVersion, | ||
| fakeDsn, | ||
| attachments: [attachment], | ||
| ); | ||
|
|
||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -16,7 +16,7 @@ import '../mocks.dart'; | |
|
|
||
| void main() { | ||
| SentryEnvelope givenEnvelope() { | ||
| final filteredEnvelopeHeader = SentryEnvelopeHeader(SentryId.empty(), null); | ||
| final filteredEnvelopeHeader = SentryEnvelopeHeader(SentryId.empty(), null, null); | ||
| final filteredItemHeader = | ||
| SentryEnvelopeItemHeader(SentryItemType.event, () async { | ||
| return 2; | ||
|
|
@@ -66,8 +66,9 @@ void main() { | |
| final sut = fixture.getSut(httpMock, mockRateLimiter); | ||
|
|
||
| final sentryEvent = SentryEvent(); | ||
| final fakeDsn = 'https://[email protected]/1234567'; | ||
| final envelope = | ||
| SentryEnvelope.fromEvent(sentryEvent, fixture.options.sdk); | ||
| SentryEnvelope.fromEvent(sentryEvent, fixture.options.sdk, fakeDsn); | ||
| await sut.send(envelope); | ||
|
|
||
| final envelopeData = <int>[]; | ||
|
|
@@ -90,8 +91,9 @@ void main() { | |
| final sut = fixture.getSut(httpMock, mockRateLimiter); | ||
|
|
||
| final sentryEvent = SentryEvent(); | ||
| final fakeDsn = 'https://[email protected]/1234567'; | ||
| final envelope = | ||
| SentryEnvelope.fromEvent(sentryEvent, fixture.options.sdk); | ||
| SentryEnvelope.fromEvent(sentryEvent, fixture.options.sdk, fakeDsn); | ||
| final eventId = await sut.send(envelope); | ||
|
|
||
| expect(eventId, SentryId.empty()); | ||
|
|
@@ -114,8 +116,9 @@ void main() { | |
| final sut = fixture.getSut(httpMock, mockRateLimiter); | ||
|
|
||
| final sentryEvent = SentryEvent(); | ||
| final fakeDsn = 'https://[email protected]/1234567'; | ||
| final envelope = | ||
| SentryEnvelope.fromEvent(sentryEvent, fixture.options.sdk); | ||
| SentryEnvelope.fromEvent(sentryEvent, fixture.options.sdk, fakeDsn); | ||
| await sut.send(envelope); | ||
|
|
||
| expect(mockRateLimiter.envelopeToFilter?.header.eventId, | ||
|
|
@@ -135,8 +138,9 @@ void main() { | |
| final sut = fixture.getSut(httpMock, mockRateLimiter); | ||
|
|
||
| final sentryEvent = SentryEvent(); | ||
| final fakeDsn = 'https://[email protected]/1234567'; | ||
| final envelope = | ||
| SentryEnvelope.fromEvent(sentryEvent, fixture.options.sdk); | ||
| SentryEnvelope.fromEvent(sentryEvent, fixture.options.sdk, fakeDsn); | ||
| await sut.send(envelope); | ||
|
|
||
| expect(mockRateLimiter.errorCode, 200); | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -128,9 +128,12 @@ class FunctionEventProcessor extends EventProcessor { | |
| typedef EventProcessorFunction = FutureOr<SentryEvent?> | ||
| Function(SentryEvent event, {dynamic hint}); | ||
|
|
||
| final fakeDsn = 'https://[email protected]/1234567'; | ||
|
|
||
| var fakeEnvelope = SentryEnvelope.fromEvent( | ||
| fakeEvent, | ||
| SdkVersion(name: 'sdk1', version: '1.0.0'), | ||
| fakeDsn, | ||
| ); | ||
|
|
||
| class MockRateLimiter implements RateLimiter { | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -28,8 +28,9 @@ void main() { | |
| final event = SentryEvent(); | ||
| final sdkVersion = | ||
| SdkVersion(name: 'fixture-sdkName', version: 'fixture-sdkVersion'); | ||
| final fakeDsn = 'https://[email protected]/1234567'; | ||
|
|
||
| final envelope = SentryEnvelope.fromEvent(event, sdkVersion); | ||
| final envelope = SentryEnvelope.fromEvent(event, sdkVersion, fakeDsn); | ||
| final sentryId = await transport.send(envelope); | ||
|
|
||
| expect(sentryId, sentryId); | ||
|
|
@@ -44,8 +45,9 @@ void main() { | |
| final event = SentryEvent(); | ||
| final sdkVersion = | ||
| SdkVersion(name: 'fixture-sdkName', version: 'fixture-sdkVersion'); | ||
| final fakeDsn = 'https://[email protected]/1234567'; | ||
|
|
||
| final envelope = SentryEnvelope.fromEvent(event, sdkVersion); | ||
| final envelope = SentryEnvelope.fromEvent(event, sdkVersion, fakeDsn); | ||
| final sentryId = await transport.send(envelope); | ||
|
|
||
| expect(SentryId.empty(), sentryId); | ||
|
|
@@ -63,7 +65,8 @@ void main() { | |
| SentryEvent(message: SentryMessage('hi I am a special char ◤')); | ||
| final sdkVersion = | ||
| SdkVersion(name: 'fixture-sdkName', version: 'fixture-sdkVersion'); | ||
| final envelope = SentryEnvelope.fromEvent(event, sdkVersion); | ||
| final fakeDsn = 'https://[email protected]/1234567'; | ||
| final envelope = SentryEnvelope.fromEvent(event, sdkVersion, fakeDsn); | ||
| await transport.send(envelope); | ||
|
|
||
| final envelopeList = arguments as List; | ||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.