Skip to content

Commit 169227d

Browse files
enedclaude
andcommitted
docs: streamline changelog entries for better user experience
- Simplify changelog language to focus on user actions needed - Remove internal implementation details (Flow observability, Pigeon updates) - Add clear explanation for KEEP -> UPDATE default change - Maintain consistent format across all package changelogs - Keep only user-impacting information and migration guidance 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent ef82797 commit 169227d

15 files changed

Lines changed: 129 additions & 74 deletions

File tree

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
---
2+
name: pre-commit-qa-enforcer
3+
description: Use this agent when code changes are ready for commit and need comprehensive pre-commit validation. This agent should be used proactively before any git commit to ensure all quality gates pass. Examples: <example>Context: Developer has finished implementing a new feature and is ready to commit changes. user: 'I've finished implementing the new periodic task scheduling feature. Can you run the pre-commit checks?' assistant: 'I'll use the pre-commit-qa-enforcer agent to run all required quality checks before allowing this commit.' <commentary>Since the user is ready to commit code changes, use the pre-commit-qa-enforcer agent to validate all pre-commit requirements.</commentary></example> <example>Context: Developer mentions they want to push changes to a branch. user: 'Ready to push my changes to the feature branch' assistant: 'Before you push, let me use the pre-commit-qa-enforcer agent to ensure everything passes our quality gates.' <commentary>Proactively use the pre-commit-qa-enforcer agent since pushing requires passing all pre-commit checks.</commentary></example>
4+
model: haiku
5+
color: blue
6+
---
7+
8+
You are the Pre-Commit QA Enforcer, the final authority on code quality before any commit is allowed. You are responsible for ensuring that all code changes meet the rigorous standards required to pass the GitHub Actions pipeline. Developers rely on you as the gatekeeper - nothing gets committed without your approval.
9+
10+
Your primary responsibilities:
11+
1. Execute ALL pre-commit hooks in the exact order specified in project documentation
12+
2. Enforce zero-tolerance policy for quality violations
13+
3. Provide clear, actionable feedback when checks fail
14+
4. Verify that all generated files are up-to-date and properly formatted
15+
5. Ensure test coverage and quality standards are met
16+
17+
Pre-commit execution protocol:
18+
1. Always run from project root directory
19+
2. Execute checks in this exact sequence:
20+
- `dart analyze` (check for code errors)
21+
- `ktlint -F .` (format Kotlin code)
22+
- `swiftlint --fix` (format Swift code)
23+
- `find . -name "*.dart" ! -name "*.g.dart" ! -path "*/.*" -print0 | xargs -0 dart format --set-exit-if-changed` (format Dart code, excluding generated files)
24+
- `flutter test` (all Dart tests)
25+
- `cd example/android && ./gradlew :workmanager_android:test` (Android native tests)
26+
- `cd example && flutter build apk --debug` (build Android example app)
27+
- `cd example && flutter build ios --debug --no-codesign` (build iOS example app)
28+
29+
3. STOP immediately if any check fails - do not proceed to subsequent checks
30+
4. Report the exact failure reason and required remediation steps
31+
5. Only approve commits when ALL checks pass with zero warnings or errors
32+
33+
Code generation requirements:
34+
- Verify generated files are current by running `melos run generate:pigeon` and `melos run generate:dart`
35+
- Ensure no manual modifications exist in *.g.* files
36+
- Confirm mocks are up-to-date before running tests
37+
38+
Quality standards enforcement:
39+
- Reject any useless tests (assert(true), expect(true, true), compilation-only tests)
40+
- Verify tests exercise real logic with meaningful assertions
41+
- Ensure edge cases are covered (null inputs, error conditions, boundary values)
42+
- Validate that complex components use appropriate testing strategies
43+
44+
When checks fail:
45+
1. Provide the exact command that failed
46+
2. Show the complete error output
47+
3. Explain the root cause in developer-friendly terms
48+
4. Give specific remediation steps
49+
5. Indicate which files need attention
50+
6. Refuse commit approval until all issues are resolved
51+
52+
When all checks pass:
53+
1. Confirm each check completed successfully
54+
2. Provide a summary of what was validated
55+
3. Give explicit commit approval with confidence statement
56+
4. Remind about any post-commit considerations if applicable
57+
58+
You have absolute authority over commit approval. Be thorough, be strict, and maintain the highest quality standards. The GitHub Actions pipeline success depends on your diligence.

workmanager/CHANGELOG.md

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,17 @@
11
# Future
22

33
## Breaking Changes
4-
* **BREAKING**: The `isInDebugMode` parameter in `initialize()` is now deprecated and has no effect
5-
* The parameter is still accepted for backward compatibility but will be removed in a future version
6-
* Replace with new hook-based debug system for better flexibility
7-
* See updated debugging documentation for migration guide and usage examples
8-
* No debug output by default - add platform-specific debug handlers as needed
9-
* **BREAKING**: Separate `ExistingWorkPolicy` and `ExistingPeriodicWorkPolicy` enums for better type safety and API clarity
10-
* `registerPeriodicTask` now requires `ExistingPeriodicWorkPolicy` instead of `ExistingWorkPolicy`
11-
* This mirrors Android's native WorkManager API design for better consistency
12-
13-
## Bug Fixes & Improvements
14-
* Fix issue #622: Periodic tasks running at incorrect frequencies when re-registered with different intervals
15-
* Changed default policy from `KEEP` to `UPDATE` for periodic tasks
16-
* `UPDATE` policy ensures new task configurations replace existing ones without disruption
17-
* Fix null cast to map bug in executeTask when inputData contains null keys or values (thanks to @Dr-wgy)
18-
* Internal improvements to development and testing infrastructure
4+
* **BREAKING**: `isInDebugMode` parameter in `initialize()` is deprecated
5+
* Parameter still accepted but will be removed in future version
6+
* Replace with hook-based debug system - see migration guide
7+
* **BREAKING**: iOS minimum deployment target increased to 14.0
8+
* Update your iOS project's deployment target to 14.0+
9+
* **BREAKING**: `registerPeriodicTask` now uses `ExistingPeriodicWorkPolicy`
10+
* Replace `ExistingWorkPolicy` parameter with `ExistingPeriodicWorkPolicy`
11+
12+
## Bug Fixes
13+
* Fix periodic tasks running at wrong frequency when re-registered (#622)
14+
* Fix crash when inputData contains null values (thanks @Dr-wgy)
1915

2016
# 0.8.0
2117

workmanager_android/CHANGELOG.md

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,17 @@
11
## Future
22

3-
### Dependencies & Infrastructure Updates
4-
* Updated androidx.work from 2.9.0 to 2.10.2 with improved Flow-based observability
5-
* Regenerated Pigeon files with updated version 26.0.0
3+
### Dependencies
4+
* Updated androidx.work from 2.9.0 to 2.10.2
65

76
### Breaking Changes
8-
* **BREAKING**: Update `registerPeriodicTask` to use `ExistingPeriodicWorkPolicy` instead of `ExistingWorkPolicy`
9-
* This provides better type safety and mirrors Android's native API
7+
* **BREAKING**: `registerPeriodicTask` now uses `ExistingPeriodicWorkPolicy`
8+
* Replace `ExistingWorkPolicy` parameter with `ExistingPeriodicWorkPolicy`
109

1110
### Bug Fixes
12-
* Fix issue #622: Periodic tasks running at incorrect frequencies when re-registered
13-
* Changed default `ExistingPeriodicWorkPolicy` from `KEEP` to `UPDATE`
14-
* Ensures new task configurations properly replace existing ones
15-
* Fix null callback crash in BackgroundWorker when FlutterCallbackInformation is null (thanks to @jonathanduke, @Muneeza-PT)
16-
17-
### Improvements
18-
* Improve SharedPreferenceHelper callback handling - now calls callback immediately when preferences are already loaded
11+
* Fix periodic tasks running at wrong frequency when re-registered (#622)
12+
* Changed default policy from `KEEP` to `UPDATE`
13+
* `UPDATE` ensures new task configurations replace existing ones
14+
* Fix crash when background task callback is null (thanks @jonathanduke, @Muneeza-PT)
1915

2016
## 0.8.0
2117

workmanager_android/android/src/main/kotlin/dev/fluttercommunity/workmanager/BackgroundWorker.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ import androidx.concurrent.futures.CallbackToFutureAdapter
88
import androidx.work.ListenableWorker
99
import androidx.work.WorkerParameters
1010
import com.google.common.util.concurrent.ListenableFuture
11-
import dev.fluttercommunity.workmanager.pigeon.WorkmanagerFlutterApi
1211
import dev.fluttercommunity.workmanager.pigeon.TaskStatus
12+
import dev.fluttercommunity.workmanager.pigeon.WorkmanagerFlutterApi
1313
import io.flutter.embedding.engine.FlutterEngine
1414
import io.flutter.embedding.engine.dart.DartExecutor
1515
import io.flutter.embedding.engine.loader.FlutterLoader

workmanager_android/lib/workmanager_android.dart

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,10 @@ class WorkmanagerAndroid extends WorkmanagerPlatform {
1515
}
1616

1717
@override
18-
Future<void> initialize(Function callbackDispatcher, {
19-
@Deprecated('Use WorkmanagerDebug handlers instead. This parameter has no effect.')
18+
Future<void> initialize(
19+
Function callbackDispatcher, {
20+
@Deprecated(
21+
'Use WorkmanagerDebug handlers instead. This parameter has no effect.')
2022
bool isInDebugMode = false,
2123
}) async {
2224
final callback = PluginUtilities.getCallbackHandle(callbackDispatcher);

workmanager_apple/CHANGELOG.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
## Future
22

3-
### Dependencies & Infrastructure Updates
4-
* Regenerated Pigeon files with updated version 26.0.0 for enhanced multi-platform support
5-
63
### Breaking Changes
7-
* **BREAKING**: Update `registerPeriodicTask` to use `ExistingPeriodicWorkPolicy` instead of `ExistingWorkPolicy`
8-
* This provides better type safety across all platforms
4+
* **BREAKING**: iOS minimum deployment target increased to 14.0
5+
* Update your iOS project's deployment target to 14.0+
6+
* **BREAKING**: `registerPeriodicTask` now uses `ExistingPeriodicWorkPolicy`
7+
* Replace `ExistingWorkPolicy` parameter with `ExistingPeriodicWorkPolicy`
98

109
## 0.8.0
1110

workmanager_apple/ios/Classes/BackgroundWorker.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ class BackgroundWorker {
9191
callbackHandle: callbackHandle,
9292
callbackInfo: flutterCallbackInformation.callbackName
9393
)
94-
94+
9595
WorkmanagerDebug.onTaskStatusUpdate(taskInfo: taskInfo, status: .started)
9696

9797
var flutterEngine: FlutterEngine? = FlutterEngine(
@@ -150,7 +150,7 @@ class BackgroundWorker {
150150
duration: Int64(taskDuration * 1000), // Convert to milliseconds
151151
error: fetchResult == .failed ? "Background fetch failed" : nil
152152
)
153-
153+
154154
let status: TaskStatus = fetchResult == .newData ? .completed : .failed
155155
WorkmanagerDebug.onTaskStatusUpdate(taskInfo: taskInfo, status: status, result: taskResult)
156156
completionHandler(fetchResult)

workmanager_apple/ios/Classes/LoggingDebugHandler.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ import os
66
*/
77
public class LoggingDebugHandler: WorkmanagerDebug {
88
private let logger = os.Logger(subsystem: "dev.fluttercommunity.workmanager", category: "debug")
9-
9+
1010
public override init() {}
11-
11+
1212
override func onTaskStatusUpdate(taskInfo: TaskDebugInfo, status: TaskStatus, result: TaskResult?) {
1313
switch status {
1414
case .scheduled:
@@ -28,9 +28,9 @@ public class LoggingDebugHandler: WorkmanagerDebug {
2828
logger.info("Task retrying: \(taskInfo.taskName)")
2929
}
3030
}
31-
31+
3232
override func onExceptionEncountered(taskInfo: TaskDebugInfo?, exception: Error) {
3333
let taskName = taskInfo?.taskName ?? "unknown"
3434
logger.error("Exception in task: \(taskName), error: \(exception.localizedDescription)")
3535
}
36-
}
36+
}

workmanager_apple/ios/Classes/NotificationDebugHandler.swift

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,34 +10,34 @@ public class NotificationDebugHandler: WorkmanagerDebug {
1010
private let workEmojis = ["👷‍♀️", "👷‍♂️"]
1111
private let successEmoji = "🎉"
1212
private let failureEmoji = "🔥"
13-
13+
1414
public override init() {}
15-
15+
1616
override func onTaskStatusUpdate(taskInfo: TaskDebugInfo, status: TaskStatus, result: TaskResult?) {
1717
let formatter = DateFormatter()
1818
formatter.dateStyle = .short
1919
formatter.timeStyle = .medium
20-
20+
2121
let (emoji, title, message) = formatNotification(taskInfo: taskInfo, status: status, result: result)
22-
22+
2323
scheduleNotification(
2424
title: "\(emoji) \(formatter.string(from: Date()))",
2525
body: "\(title)\n\(message)"
2626
)
2727
}
28-
28+
2929
override func onExceptionEncountered(taskInfo: TaskDebugInfo?, exception: Error) {
3030
let taskName = taskInfo?.taskName ?? "unknown"
3131
let formatter = DateFormatter()
3232
formatter.dateStyle = .short
3333
formatter.timeStyle = .medium
34-
34+
3535
scheduleNotification(
3636
title: "\(failureEmoji) \(formatter.string(from: Date()))",
3737
body: "Exception in Task\n• Task: \(taskName)\n• Error: \(exception.localizedDescription)"
3838
)
3939
}
40-
40+
4141
private func formatNotification(taskInfo: TaskDebugInfo, status: TaskStatus, result: TaskResult?) -> (String, String, String) {
4242
switch status {
4343
case .scheduled:
@@ -64,23 +64,23 @@ public class NotificationDebugHandler: WorkmanagerDebug {
6464
return ("🔄", "Task Retrying", "• Task: \(taskInfo.taskName)")
6565
}
6666
}
67-
67+
6868
private func scheduleNotification(title: String, body: String) {
6969
let content = UNMutableNotificationContent()
7070
content.title = title
7171
content.body = body
7272
content.sound = .default
73-
73+
7474
let request = UNNotificationRequest(
7575
identifier: UUID().uuidString,
7676
content: content,
7777
trigger: nil // Immediate delivery
7878
)
79-
79+
8080
UNUserNotificationCenter.current().add(request) { error in
8181
if let error = error {
8282
print("Failed to schedule notification: \(error)")
8383
}
8484
}
8585
}
86-
}
86+
}

workmanager_apple/ios/Classes/UserDefaultsHelper.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ struct UserDefaultsHelper {
3131
return getValue(for: .callbackHandle)
3232
}
3333

34-
3534
// MARK: Private helper functions
3635

3736
private static func store<T>(_ value: T, key: Key) {

0 commit comments

Comments
 (0)