-
-
Notifications
You must be signed in to change notification settings - Fork 237
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
Finish a transaction never returns on iOS after being in background #2007
Comments
Hi thanks for raising this issue, before going deeper into this: do you know if this is also reproducible with a shorter background time? |
I am not sure and do not have exact numbers, but I think sometimes it happened also for shorter background times. However, the ~30min seemed to give me the problem reliably (nearly) every time. |
Got it, thanks for the issue, we'll try to reproduce. If you have any more info lmk |
I believe I found the culprit, the I believe the @NikHomann Not fully sure that this is the same reason for your case. I am manually starting a new isolate and initialize Sentry with Workaround: // NativeAppStartIntegration is not exported
// ignore: implementation_imports
import 'package:sentry_flutter/src/integrations/native_app_start_integration.dart';
options.removeIntegration(options.integrations.firstWhere((e) => e is NativeAppStartIntegration)); |
we didn't account for |
I am still experiencing 30 sec timeouts here. |
hey, I'll take another look, sorry about that, I'll try to get to it today or tomorrow since next week will be a bit slower because of droid/fluttercon |
No worries, see you in Berlin 👋 |
Not completely sure but I think the |
I think you can do something like
Which should be the NativeAppStartIntegration, I'm currently on my phone so I can't verify the correctness of the code but afaik it should be possible to remove |
hey this code will help you remove/disable it: final integration = options.integrations.firstWhere(
(element) => element.toString().contains('NativeAppStartIntegration'));
options.removeIntegration(integration); |
Yea, I restored my workaround from #2007 (comment) which I removed when |
To me it looks like the flutter sdk is also the only SDK that has this API. |
by the way do have a way to reproduce it reliably? or is it just something that happens once in a while |
#2140 I've added a fix that will not wait for |
I am starting a new |
ah yeah looks like it |
I am also experiencing this issue on Android on some of my testings. Is a fix for it available? |
the temporary workaround with disabling the app start integration is safe to use. this is only used to instrument the app start times |
@buenaflor This is exactly what I was trying to do when I figured out the bug 😢 |
@shinayser did you successfully remove the integration? |
@buenaflor So, my problem is that I am actually starting sentry in the native side (on Android, Application.kt class) and using the parameter Because of that, when removing the integration and caling the In resume, this workaround works but if you are using the native sdk startup you wil be in trouble and sentry will not be able to finish transactions. |
@shinayser and you're using the |
Yes |
Platform
Flutter Mobile
Obfuscation
Disabled
Debug Info
Disabled
Doctor
[√] Flutter (Channel stable, 3.19.4, on Microsoft Windows [Version 10.0.19045.4291], locale de-DE)
• Flutter version 3.19.4 on channel stable at C:\Users\Niklas\fvm\versions\3.19.4
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 68bfaea224 (5 weeks ago), 2024-03-20 15:36:31 -0700
• Engine revision a5c24f538d
• Dart version 3.3.2
• DevTools version 2.31.1
Version
7.18.0
Steps to Reproduce
How to create a reproducible example:
await Sentry.startTransaction("test", "test").finish()
somewhere, for instance in the basic flutter example before counter is incrementedSteps to Reproduce:
If you downgrade to version 7.10.1 (there might be others, but this is the version I was using before) it works as expected.
Expected Result
The
transaction.finish(...)
returns after a short amount of time and the transaction is logged in Sentry.Actual Result
The
transaction.finish(...)
never returns and the transaction is not logged in Sentry.Are you willing to submit a PR?
No
The text was updated successfully, but these errors were encountered: