Context
The debug-handler system (WorkmanagerDebug.setCurrent(...)) currently exists only on Android (Kotlin) and iOS/macOS (Swift). The web, linux and windows implementations are pure Dart, so they have no equivalent — debug information on those platforms is limited to what the developer prints themselves.
The API shape (see workmanager_android/.../WorkmanagerDebugHandler.kt):
TaskDebugInfo(taskName, uniqueName, inputData, startTime)
TaskResult(success, duration, error)
WorkmanagerDebug with onTaskStatusUpdate(taskInfo, status, result) and onExceptionEncountered(taskInfo, exception)
WorkmanagerDebug.setCurrent(handler) / getCurrent()
- Built-in handlers:
LoggingDebugHandler, NotificationDebugHandler
Proposal
Add a Dart-side mirror of the same API in the workmanager package (so the call site looks identical across platforms) and emit status updates from the Dart platform implementations:
WorkmanagerDebug.setCurrent(...) with the same handler contract (minus platform-specific context).
LoggingDebugHandler (prints to console) + web-capable NotificationDebugHandler (browser notifications on web; no-op elsewhere).
- Wire emission:
- web (
workmanager_web): task start/completion/failure in the execution path, and dispatcher exceptions.
- linux (
workmanager_linux): in BackgroundTaskRunner.
- windows (
workmanager_windows): in the Dart execution path.
Acceptance criteria
WorkmanagerDebug.setCurrent(LoggingDebugHandler()) works identically on web, linux, windows (and stays a no-op-friendly default).
- Custom handlers receive
onTaskStatusUpdate / onExceptionEncountered with the same TaskDebugInfo/TaskStatus/TaskResult semantics.
- Android/iOS keep their existing native API unchanged.
Context
The debug-handler system (
WorkmanagerDebug.setCurrent(...)) currently exists only on Android (Kotlin) and iOS/macOS (Swift). The web, linux and windows implementations are pure Dart, so they have no equivalent — debug information on those platforms is limited to what the developer prints themselves.The API shape (see
workmanager_android/.../WorkmanagerDebugHandler.kt):TaskDebugInfo(taskName, uniqueName, inputData, startTime)TaskResult(success, duration, error)WorkmanagerDebugwithonTaskStatusUpdate(taskInfo, status, result)andonExceptionEncountered(taskInfo, exception)WorkmanagerDebug.setCurrent(handler)/getCurrent()LoggingDebugHandler,NotificationDebugHandlerProposal
Add a Dart-side mirror of the same API in the
workmanagerpackage (so the call site looks identical across platforms) and emit status updates from the Dart platform implementations:WorkmanagerDebug.setCurrent(...)with the same handler contract (minus platform-specificcontext).LoggingDebugHandler(prints to console) + web-capableNotificationDebugHandler(browser notifications on web; no-op elsewhere).workmanager_web): task start/completion/failure in the execution path, and dispatcher exceptions.workmanager_linux): inBackgroundTaskRunner.workmanager_windows): in the Dart execution path.Acceptance criteria
WorkmanagerDebug.setCurrent(LoggingDebugHandler())works identically on web, linux, windows (and stays a no-op-friendly default).onTaskStatusUpdate/onExceptionEncounteredwith the sameTaskDebugInfo/TaskStatus/TaskResultsemantics.