Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

feat: WorkmanagerDebug handlers on web, linux and windows (same API as Android/iOS)

未关闭
#729 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
55/100
Issue 类型
功能
描述清晰度
基本清楚
活跃度
冷清
技术栈
dart, flutter

调研方向

阅读现有的 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)
  • 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.
主要语言
Dart
星标
1k
派生
362
PR 合并指标
30 天内没有已合并 PR

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

fluttercommunity/flutter_workmanager 的其他 Issue

查看 fluttercommunity/flutter_workmanager 的全部 Issue

相似的 Issue

更多 Dart Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。