-
-
Notifications
You must be signed in to change notification settings - Fork 246
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix/screenshot masking during changes (#2553)
* capture screenshots in sequence until they're stable * improve timestamps * fix tests & future handling * example: debug log only in debug mode * formatting * min-version compat * linter issue * fix scheduler tests * cleanup * fix: scheduler test * improve performance * improve screenshot comparison performance * comments * screenshot list-equal fix & tests * min-version failure * rename retrier to stabilizer * chore: changelog * capture stable issue screenshots when masking is enabled * fixes and tests * better logging * cocoa replay fix * fix dart2js tests * fix screenshot capture hanging * fix integration test * time out if we can't take a screenshot for events * update ios app size metrics check * fix: oom
- Loading branch information
Showing
21 changed files
with
637 additions
and
215 deletions.
There are no files selected for viewing
This file contains 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 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 @@ | ||
description: This file stores settings for Dart & Flutter DevTools. | ||
documentation: https://docs.flutter.dev/tools/devtools/extensions#configure-extension-enablement-states | ||
extensions: |
This file contains 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 |
---|---|---|
|
@@ -20,6 +20,8 @@ void main() { | |
const fakeDsn = 'https://[email protected]/1234567'; | ||
|
||
IntegrationTestWidgetsFlutterBinding.ensureInitialized(); | ||
IntegrationTestWidgetsFlutterBinding.instance.framePolicy = | ||
LiveTestWidgetsFlutterBindingFramePolicy.fullyLive; | ||
|
||
tearDown(() async { | ||
await Sentry.close(); | ||
|
This file contains 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 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 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,40 @@ | ||
import 'dart:async'; | ||
import 'dart:typed_data'; | ||
|
||
import 'package:meta/meta.dart'; | ||
|
||
import '../../../sentry_flutter.dart'; | ||
import '../../replay/replay_recorder.dart'; | ||
import '../../screenshot/recorder.dart'; | ||
import '../../screenshot/recorder_config.dart'; | ||
import '../../screenshot/stabilizer.dart'; | ||
|
||
@internal | ||
class CocoaReplayRecorder { | ||
final SentryFlutterOptions _options; | ||
final ScreenshotRecorder _recorder; | ||
late final ScreenshotStabilizer<void> _stabilizer; | ||
var _completer = Completer<Uint8List?>(); | ||
|
||
CocoaReplayRecorder(this._options) | ||
: _recorder = | ||
ReplayScreenshotRecorder(ScreenshotRecorderConfig(), _options) { | ||
_stabilizer = ScreenshotStabilizer(_recorder, _options, (screenshot) async { | ||
final pngData = await screenshot.pngData; | ||
_options.logger( | ||
SentryLevel.debug, | ||
'Replay: captured screenshot (' | ||
'${screenshot.width}x${screenshot.height} pixels, ' | ||
'${pngData.lengthInBytes} bytes)'); | ||
_completer.complete(pngData.buffer.asUint8List()); | ||
}); | ||
} | ||
|
||
Future<Uint8List?> captureScreenshot() async { | ||
_completer = Completer<Uint8List?>(); | ||
_stabilizer.ensureFrameAndAddCallback((msSinceEpoch) { | ||
_stabilizer.capture(msSinceEpoch).onError(_completer.completeError); | ||
}); | ||
return _completer.future; | ||
} | ||
} |
This file contains 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 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 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.