Skip to content
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

Upgrade Flutter and packages #1278

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

rajveermalviya
Copy link
Collaborator

Fixes: #942

@rajveermalviya rajveermalviya added the maintainer review PR ready for review by Zulip maintainers label Jan 13, 2025
@PIG208 PIG208 self-assigned this Jan 16, 2025
And update Flutter's supporting libraries to match.
Fixes: zulip#942

And migrate to using non-nullable generic types.

Changelog:
  https://pub.dev/packages/pigeon/changelog#2272
Upgrade carried using by following commands:
  flutter pub upgrade --major-versions firebase_messaging firebase_core
  pod update --project-directory=ios/
  pod update --project-directory=macos/

And adapted the test bindings to use the new
`providesAppNotificationSettings` flag.

Changelogs:
  https://pub.dev/packages/firebase_core/changelog#3100
  https://pub.dev/packages/firebase_messaging/changelog#1520
Copy link
Member

@PIG208 PIG208 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR! I checked the changelogs from the upgrades. None of the breaking changes packages from the tools/upgrade pub-major upgrade affects us. The app also works fine on my Android device. It would be great to have it tested on someone's iOS device too.

Left some comments, but no action is required for moving this PR forward.

@@ -417,6 +418,7 @@ class FakeFirebaseMessaging extends Fake implements FirebaseMessaging {
bool criticalAlert = false,
bool provisional = false,
bool sound = true,
bool providesAppNotificationSettings = false,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not directly related, but I noticed that the documentation https://firebase.flutter.dev/docs/messaging/permissions/#permission-settings we linked at NotificationService._requestPermission does not seem up-to-date with the actual requestPermission method.

// so return the default value.
@override
// ignore: non_constant_identifier_names
final String pigeonVar_messageChannelSuffix = '';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if dartHostTestHandler helps, but it is also subject to removal (flutter/flutter#159886). Mocking HostApi this way seems fine to me. Maybe these pigeonVar prefixed variables should be private in the generated code.

@PIG208 PIG208 added integration review Added by maintainers when PR may be ready for integration and removed maintainer review PR ready for review by Zulip maintainers labels Jan 16, 2025
@PIG208 PIG208 requested a review from gnprice January 16, 2025 18:50
@PIG208 PIG208 assigned gnprice and unassigned PIG208 Jan 16, 2025
Copy link
Member

@gnprice gnprice left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @rajveermalviya for taking care of this, and @PIG208 for the previous review and the manual testing!

Generally this all looks good — one request below to split up a commit. The other comments are all just me reading the changelogs, the results of which are all that there's nothing more we need to do. I can add that information to the commit messages before merge.

The app also works fine on my Android device. It would be great to have it tested on someone's iOS device too.

For this set of upgrades I'm content with that testing you did, and not doing additional manual testing on iOS.

The main area where I'd be concerned about platform-specific issues that call for manual testing on both platforms is notifications. In this upgrade, the changelogs for the notification-related (Firebase-related) upgrades look quite benign.

final List<StoredNotificationSound?> storedSounds;
final List<StoredNotificationSound> storedSounds;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

deps: Upgrade pigeon to 22.7.2

Fixes: #942

And migrate to using non-nullable generic types.

Can the upgrade and the switch to non-nullable types be separated into two commits? I'd prefer to track which changes were required by the upgrade and which were our own choice.

Comment on lines -40 to +42
- Firebase/CoreOnly (11.4.0):
- FirebaseCore (= 11.4.0)
- Firebase/Messaging (11.4.0):
- Firebase/CoreOnly (11.6.0):
- FirebaseCore (~> 11.6.0)
- Firebase/Messaging (11.6.0):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here's the corresponding release notes:
https://firebase.google.com/support/release-notes/ios

from 11.4.0 up to 11.6.0. Most are in specific libraries we don't use, though, like Analytics or Vertex AI.

It looks like for the components we actually pull in, there's just a couple of build-time fixes in 11.4.1 and 11.4.2, then some error logging in FCM in 11.5.0. All quite innocuous, then.

Comment on lines -369 to +361
version: "3.9.0"
version: "3.10.0"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like one change at https://pub.dev/packages/firebase_core/changelog : bumps the version of the Firebase iOS SDK.

Which is probably fine but opens the question of what changed there. (OK, found that changelog and posted another comment just now with the results.)

Comment on lines -393 to +385
version: "15.1.6"
version: "15.2.0"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool, changelog all looks innocuous.

device_info_plus: ^10.0.1
device_info_plus: ^11.2.0
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like the one "breaking" change in this changelog is:

BREAKING FIX(device_info_plus): fixed webasm compliance (#3254). (e35e2123)

so I'll assume that's web-only and has no effect on us.

mime: ^1.0.5
mime: ^2.0.0
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The breaking change here is in extensionFromMime.

Looks like we don't use that method:

$ git grep extensionFromMime
$

so doesn't affect us.

flutter_lints: ^4.0.0
flutter_lints: ^5.0.0
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

By nature if this doesn't cause CI to fail, it can't have broken anything.

There is one interesting change:

So that ends the regular nagging from the analyzer to add const everywhere. As discussed in the thread, it's not clear that the performance benefit of it is/was material.

sdk: '>=3.7.0-267.0.dev <4.0.0'
flutter: '>=3.28.0-2.0.pre.38575' # 65ff060283e19423e9538c18c24e44495b70aeff
sdk: '>=3.7.0-312.0.dev <4.0.0'
flutter: '>=3.28.0-2.0.pre.38699' # d14140f85439c517c98b0c40f8eaf942fcb46c74
Copy link
Collaborator

@chrisbobbe chrisbobbe Jan 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Huh, I guess we still can't do #1204 then. 🤷‍♂️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
integration review Added by maintainers when PR may be ready for integration
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use new null-safe generics in Pigeon
4 participants