-
-
Notifications
You must be signed in to change notification settings - Fork 235
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
sentry_asset_bundle
uses loadStructuredBinaryData
which has a breaking change in latest master channel
#1166
Comments
This time it's https://master-api.flutter.dev/flutter/services/AssetBundle/loadStructuredBinaryData.html at fault. I wonder if there's a way to somehow avoid failure die to interface changes in the future. |
sentry_asset_bundle
uses loadStructuredBinaryData
which has a breaking change in latest master channel
Yeah, that's hard to keep up, not sure if there's any alternative as well. |
I think this can be fixed just like this method: sentry-dart/flutter/lib/src/sentry_asset_bundle.dart Lines 194 to 235 in 6325c3b
|
I tried but linter didnt allow me, let me double check. |
Something like the following should work @override
// This is an override on Flutter greater than xxx
// ignore: override_on_non_overriding_member
Future<T> loadStructuredBinaryData(String key, FutureOr<T> Function(ByteData data) parser) async {
final span = _hub.getSpan()?.startChild(
'file.read',
description: 'AssetBundle.loadStructuredBinaryData: ${_fileName(key)}',
);
span?.setData('file.path', key);
T data;
try {
data = await _loadStructuredBinaryData(key, parser);
_setDataLength(data, span);
span?.status = SpanStatus.ok();
} catch (exception) {
span?.throwable = exception;
span?.status = SpanStatus.internalError();
rethrow;
} finally {
await span?.finish();
}
return data;
}
// helper method to have a "typesafe" method
Future<ImmutableBuffer> _loadStructuredBinaryData(String key, FutureOr<T> Function(ByteData data) parser) {
// maybe add some error handling here
// but it's probably not needed, as you wouldn't call this method on earlier flutter versions
return (_bundle as dynamic).loadStructuredBinaryData(key, parser);
} or the following would also work by not calling the inner asset bundle: @override
// This is an override on Flutter greater than xxx
// ignore: override_on_non_overriding_member
Future<T> loadStructuredBinaryData<T>(String key, FutureOr<T> Function(ByteData data) parser) async {
final span = _hub.getSpan()?.startChild(
'file.read',
description: 'AssetBundle.loadStructuredBinaryData: ${_fileName(key)}',
);
span?.setData('file.path', key);
T data;
try {
final ByteData data = await load(key);
if (data == null) {
throw FlutterError('Unable to load asset: $key');
}
data = await parser(data);
_setDataLength(data, span);
span?.status = SpanStatus.ok();
} catch (exception) {
span?.throwable = exception;
span?.status = SpanStatus.internalError();
rethrow;
} finally {
await span?.finish();
}
return data;
} |
Thanks @ueman |
|
I bet it's coming back soon |
It's about to be re-landed flutter/flutter#116684 |
I see this issue today on a master channel. Tried with both 6.20.1 and sentry 7.0.0-beta.4:
|
Platform:
IDE:
split-debug-info and obfuscate (Flutter Android or iOS) or CanvasKit (Flutter Web):
Platform installed with:
Output of the command
flutter doctor -v
below:The version of the SDK (See pubspec.lock):
6.17.0
I have the following issue:
After upgrading to latest flutter version from "master" channel
3.7.0
application fails to compile and output error in console:Same thing happens on iOS and Android
Steps to reproduce:
flutter channel master
and runflutter upgrade
Actual result:
Expected result:
The text was updated successfully, but these errors were encountered: