-
-
Notifications
You must be signed in to change notification settings - Fork 277
Feat: Screenshot Attachment #1088
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
Merged
Merged
Changes from all commits
Commits
Show all changes
60 commits
Select commit
Hold shift + click to select a range
ab120a9
add SentryClientAttachmentProcessor to sentry dart
denrase 12a0789
process attachments in sentry client
denrase 490f68e
add missing import
denrase 34b6b1f
add sentry widget and screenshot integration + processor + attachment
denrase e6e2afe
export sentry_widget
denrase 6865a56
format
denrase 4d5b3c0
fix runtime issues
denrase e72e124
fix documentation
denrase f35689f
test new behaviour in client
denrase 33aa55c
test screenshot integration
denrase 4a4b0df
test properties
denrase 0c43605
create screenshot in processor
denrase e477d14
add changelog entry
denrase a0a094a
add opt-in to options for screenshot feature
denrase 14b157f
add comment
denrase ce8eb33
move property to flutter options
denrase 9c9d5f0
enable screenshots in example app
denrase 693b5ce
Merge branch 'main' into feat/screenshot_atachment
denrase 860ff84
rename widget
denrase 8eb3400
Merge branch 'main' into feat/screenshot_atachment
denrase 278be0d
add features section
denrase 760a472
run format
denrase fca116e
mark attahcment processor as internal
denrase 6efd03f
Merge branch 'main' into feat/screenshot_atachment
denrase 1065bb9
Merge branch 'main' into feat/screenshot_atachment
marandaneto 7e1acd0
Merge branch 'feat/screenshot_atachment' of github.com:getsentry/sent…
marandaneto 50915e1
fix attachment.addToTransactions expectation
denrase 4f3f384
Merge branch 'feat/screenshot_atachment' of github.com:getsentry/sent…
denrase e8d5e4a
move mock to mocks.dart
denrase 6f59058
change naming of global key
denrase 5a1f1ec
return just attachments if completer fails for some reason
denrase 27bf210
no need to create new list
denrase 3bc46a7
create sentry_private export file
marandaneto 97bf0d9
use sut param
denrase 3d681cc
Merge branch 'feat/screenshot_atachment' of github.com:getsentry/sent…
denrase 47024c9
Merge branch 'main' into feat/screenshot_atachment
denrase d0045a1
also install screenshot integration on window, linux & fuchsia
denrase fe0b533
only install screenshots integration with skia and canvaskit renderer
denrase 0018e50
test screenshot creation for renderers
denrase e70240e
local var for readability
denrase f8f60c9
remove unused import
denrase 24bc74f
align test setup/dependencies
denrase 0e7a5f4
move screenshot integration to own grooup
denrase 2ab5321
only run screenshot attachment test on vm
denrase 670c2e2
run tests on vm
denrase bf1c212
update comment regarding rendering
denrase 675da74
remove cp comment
denrase 63c8976
when run in web, only run this test with canvasKit renderer
denrase 07ce1e1
remove screenshot integration from native expectations
denrase c6cc51c
remove attach screenshot param
denrase 05c3680
check image resolutiona and byte count
denrase 0c943a5
log if renderer is not supported
denrase e640a40
dont use addPostFrameCallback
denrase 518fe65
Merge branch 'main' into feat/screenshot_atachment
denrase ad03524
remove unused dependency
denrase 43f977b
remove unused imports
denrase be87aa7
Merge branch 'main' into feat/screenshot_atachment
marandaneto 16dede7
fixes
marandaneto f0392b4
add comments
marandaneto 1b68c67
Merge branch 'main' into feat/screenshot_atachment
marandaneto 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| // attachments | ||
| // ignore: invalid_export_of_internal_element | ||
| export 'src/sentry_client_attachment_processor.dart'; |
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 |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| import 'dart:async'; | ||
|
|
||
| import 'package:meta/meta.dart'; | ||
|
|
||
| import './sentry_attachment/sentry_attachment.dart'; | ||
| import './protocol/sentry_event.dart'; | ||
|
|
||
| @internal | ||
| class SentryClientAttachmentProcessor { | ||
denrase marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| Future<List<SentryAttachment>> processAttachments( | ||
| List<SentryAttachment> attachments, SentryEvent event) async { | ||
| return attachments; | ||
| } | ||
| } | ||
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 |
|---|---|---|
| @@ -1,6 +1,7 @@ | ||
| import 'dart:async'; | ||
|
|
||
| import 'package:sentry/sentry.dart'; | ||
| import 'package:sentry/sentry_private.dart'; | ||
| import 'package:sentry/src/transport/rate_limiter.dart'; | ||
|
|
||
| final fakeDsn = 'https://[email protected]/1234567'; | ||
|
|
@@ -160,3 +161,23 @@ class MockRateLimiter implements RateLimiter { | |
| this.errorCode = errorCode; | ||
| } | ||
| } | ||
|
|
||
| enum MockAttachmentProcessorMode { filter, add } | ||
|
|
||
| /// Filtering out all attachments. | ||
| class MockAttachmentProcessor implements SentryClientAttachmentProcessor { | ||
| MockAttachmentProcessorMode mode; | ||
|
|
||
| MockAttachmentProcessor(this.mode); | ||
|
|
||
| @override | ||
| Future<List<SentryAttachment>> processAttachments( | ||
| List<SentryAttachment> attachments, SentryEvent event) async { | ||
| switch (mode) { | ||
| case MockAttachmentProcessorMode.filter: | ||
| return <SentryAttachment>[]; | ||
| case MockAttachmentProcessorMode.add: | ||
| return <SentryAttachment>[SentryAttachment.fromIntList([], "added")]; | ||
| } | ||
| } | ||
| } | ||
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 |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| import 'dart:async'; | ||
|
|
||
| import 'package:sentry/sentry.dart'; | ||
| import 'package:sentry/sentry_private.dart'; | ||
| import '../screenshot/screenshot_attachment_processor.dart'; | ||
| import '../sentry_flutter_options.dart'; | ||
|
|
||
| /// Adds [ScreenshotAttachmentProcessor] to options if [attachScreenshot] is true | ||
| class ScreenshotIntegration implements Integration<SentryFlutterOptions> { | ||
denrase marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| SentryFlutterOptions? _options; | ||
|
|
||
| @override | ||
| FutureOr<void> call(Hub hub, SentryFlutterOptions options) { | ||
denrase marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| if (options.attachScreenshot) { | ||
| // ignore: invalid_use_of_internal_member | ||
| options.clientAttachmentProcessor = | ||
| ScreenshotAttachmentProcessor(options); | ||
| _options = options; | ||
|
|
||
| options.sdk.addIntegration('screenshotIntegration'); | ||
| } | ||
| } | ||
|
|
||
| @override | ||
| FutureOr<void> close() { | ||
| // ignore: invalid_use_of_internal_member | ||
| _options?.clientAttachmentProcessor = SentryClientAttachmentProcessor(); | ||
| } | ||
| } | ||
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
Oops, something went wrong.
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.