-
Notifications
You must be signed in to change notification settings - Fork 236
chore: Release 5.5.0 #1133
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: Release 5.5.0 #1133
Changes from all commits
4db5342
7036d5a
f9b01d7
111e903
43644d5
7783648
ae0f975
2915e34
0d85ceb
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,5 @@ | ||
| group 'com.onesignal.flutter' | ||
| version '5.3.4' | ||
| version '5.5.0' | ||
|
|
||
| buildscript { | ||
| repositories { | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,7 +5,7 @@ class OneSignalLiveActivities { | |
| // private channels used to bridge to ObjC/Java | ||
| MethodChannel _channel = const MethodChannel('OneSignal#liveactivities'); | ||
|
|
||
| /// Indicate this device has exited a live activity, identified within OneSignal by the [activityId]. The | ||
| /// Indicate this device has entered a live activity, identified within OneSignal by the [activityId]. The | ||
| /// [token] is the ActivityKit's update token that will be used to update the live activity. | ||
| /// | ||
| /// Only applies to iOS. | ||
|
|
@@ -19,6 +19,7 @@ class OneSignalLiveActivities { | |
| /// Indicate this device has exited a live activity, identified within OneSignal by the [activityId]. | ||
| /// | ||
| /// Only applies to iOS. | ||
| @Deprecated('Currently unsupported, avoid using this method.') | ||
| Future<void> exitLiveActivity(String activityId) async { | ||
|
Comment on lines
+22
to
23
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🟡 The Extended reasoning...What the bug isIn @Deprecated(
'Currently unsupported, avoid using this method.')The deprecation message is 49 characters. The full single-line annotation with two leading spaces would be The specific code path that triggers itThe CI workflow runs
Why existing code does not prevent itThere is no pre-commit hook or editor integration enforcing The contrast with the existing ImpactEvery CI run against this PR (or any branch that contains this file state) will fail the How to fix itChange lines 22–23 to single-line: @Deprecated('Currently unsupported, avoid using this method.')Step-by-step proof
|
||
| if (defaultTargetPlatform == TargetPlatform.iOS) { | ||
| return await _channel.invokeMethod( | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🟡 The PR removes the STOP UPDATING LIVE ACTIVITY button from the UI but leaves behind dead code: exitLiveActivity() in app_viewmodel.dart (lines 504-507) and onesignal_repository.dart (lines 195-198) have no remaining callers. Additionally, onesignal_repository.dart calls OneSignal.LiveActivities.exitLiveActivity() -- the method marked @deprecated in this same PR -- without a suppress comment, producing a build warning when the demo app is compiled.
Extended reasoning...
What the bug is
This PR removes the STOP UPDATING LIVE ACTIVITY button from live_activities_section.dart (lines 82-87 in the diff). That button called vm.exitLiveActivity() in the viewmodel. However, the removal was not propagated down the calling chain: the exitLiveActivity() methods in both examples/demo/lib/viewmodels/app_viewmodel.dart (lines 504-507) and examples/demo/lib/repositories/onesignal_repository.dart (lines 195-198) were left intact with no remaining UI callers, making them dead code.
The specific code path that triggers it
Before this PR: UI button calls vm.exitLiveActivity(), which calls _repository.exitLiveActivity(), which calls OneSignal.LiveActivities.exitLiveActivity(activityId). After this PR, the UI button is removed but the entire chain below it remains. Searching the demo app lib directory for callers of vm.exitLiveActivity() returns only the method definition itself -- confirming it is unreachable dead code. There is a second distinct issue: onesignal_repository.dart line 197 calls OneSignal.LiveActivities.exitLiveActivity(activityId) -- the exact method marked @deprecated in this same PR -- without any suppress comment.
Why existing code does not prevent it
There is no static analysis rule or linting configuration in the demo app that flags unreachable instance methods. The Dart analyzer does not treat public instance methods as dead code even when no callers exist, so the compiler will not emit a warning about the orphaned viewmodel and repository methods. The missing suppress comment in onesignal_repository.dart is separately noteworthy because the test file at test/liveactivities_test.dart correctly added the suppress comment before its call to the same deprecated method, demonstrating the project is aware of the requirement -- but the demo repository was not updated consistently.
Impact
The impact is limited to the demo app example code and does not affect the core SDK. The dead code creates maintenance confusion, and building the demo app will emit a Dart deprecation warning at onesignal_repository.dart:197 because exitLiveActivity was marked @deprecated in this exact PR. While not a runtime failure, the warning is a direct inconsistency introduced by this PR and is avoidable.
How to fix
Remove exitLiveActivity() from both app_viewmodel.dart (lines 504-507) and onesignal_repository.dart (lines 195-198). If the methods are intentionally retained for possible future use, add the appropriate ignore comment to the call in onesignal_repository.dart to suppress the warning. The cleaner approach is full removal since the UI entry point is gone.
Step-by-step proof