25s Timeout in Android #30
-
|
I’m seeing the following log in my Flutter app: It appears the DartWorker has a hard timeout of 25 seconds. Is this timeout configurable? My background task performs a long-running operation that cannot realistically be split into smaller tasks. What are the recommended approaches in this case? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
|
Hi @devroble , Thank you for reporting this. This issue has been fully resolved in version 1.2.7, which is now live on pub.dev. 🔍 Root CausePreviously, the 🛠 The FixThe native bridges now properly propagate the ✅ ResolutionSimply update your dependencies:
native_workmanager: ^1.2.7Your custom NativeWorkManager.enqueue(
taskId: 'my_long_task',
trigger: const TaskTrigger.oneTime(),
worker: DartWorker(
callbackId: 'my_sync_callback',
timeoutMs: 45000, // This will now properly lift the 25s default
),
);Please upgrade to |
Beta Was this translation helpful? Give feedback.
Hi @devroble ,
Thank you for reporting this. This issue has been fully resolved in version 1.2.7, which is now live on pub.dev.
🔍 Root Cause
Previously, the
timeoutMsvalue configured in theDartWorkerwas not being correctly forwarded through the Android and iOS native bridges. Because the Dart dispatcher couldn't read the user-supplied value, it always fell back to a hardcoded safety default of 25 seconds. This caused any long-running Dart callback to be terminated prematurely, regardless of thetimeoutMsconfiguration.🛠 The Fix
The native bridges now properly propagate the
timeoutMsfield end-to-end to the Dart callback dispatcher. We've also added strict type validation to ensure the…