feat: WorkmanagerDebug handlers on web, linux and windows (same API as Android/iOS)
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 55/100
- Issue 类型
- 功能
- 描述清晰度
- 基本清楚
- 活跃度
- 冷清
- 领域
- api, desktop-dev, mobile-dev, web-dev
调研方向
阅读现有的 WorkmanagerDebugHandler.kt API,然后检查 web dispatcher 执行路径、linux BackgroundTaskRunner 和 windows Dart 执行路径。在定义 Dart 端镜像之前,追踪任务在哪里启动、完成和失败,以及异常在哪里报告。完成的标准是,web、linux 和 windows 上匹配的处理器都能接收到指定的状态和异常回调,同时 Android 和 iOS 保持不变。
由索引模型根据 Issue 内容生成。
描述
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()- 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-specificcontext).LoggingDebugHandler(prints to console) + web-capableNotificationDebugHandler(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): inBackgroundTaskRunner. - windows (
workmanager_windows): in the Dart execution path.
- web (
Acceptance criteria
WorkmanagerDebug.setCurrent(LoggingDebugHandler())works identically on web, linux, windows (and stays a no-op-friendly default).- Custom handlers receive
onTaskStatusUpdate/onExceptionEncounteredwith the sameTaskDebugInfo/TaskStatus/TaskResultsemantics. - Android/iOS keep their existing native API unchanged.
- 主要语言
- Dart
- 星标
- 1k
- 派生
- 362
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
fluttercommunity/flutter_workmanager 的其他 Issue
-
workmanager_android: guarded apply plugin: 'kotlin-android' is the pattern Flutter says will stop building (flutter/flutter#189770)可能重新可做 关联的 PR 已关闭且未合并。 未关闭
难度 3/5 1-2 天 新手友好度 58/100
fluttercommunity/flutter_workmanager#743 · 1 条评论 ·
-
bug
难度 4/5 3-5 天 新手友好度 52/100
fluttercommunity/flutter_workmanager#742 · 3 条评论 ·
查看 fluttercommunity/flutter_workmanager 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 82/100
google/skills_lint.dart#165 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 67/100
维护者通常 1 天内回复
-
good first issue help wanted translation
难度 2/5 1-3 小时 新手友好度 86/100
blankframe-tech/ThrottleIQ#23 ·
维护者通常 5 天内回复
-
good first issue mobile P0 size:S
难度 2/5 1-3 小时 新手友好度 68/100
-
难度 2/5 1-3 小时 新手友好度 69/100
trufi-association/trufi-core#1024 ·
维护者通常 14 天内回复