Skip to content

Conversation

@stuartmorgan-g
Copy link
Collaborator

Follow-up to #6262, converting the nested data objects from the legacy JSON conversion to typed Pigeon objects.

Deprecates all the JSON code in the wrapper objects, but does not remove it because, unfortunately, the wrapper objects were both platform data transfer objects and the public API surface, so the JSON serialization/deserialization code that was part of those objects for platform channel usage is part of the public API as well. At some point we can do a breaking change to clean up that code (flutter/flutter#146202).

Fixes flutter/flutter#117910

Pre-launch Checklist

};
}

/// Creates a [PricingPhaseWrapper] from its Pigeon equivalent.
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

In most Pigeon conversions this new code would be offset by removing a bunch of manual JSON conversion on the Dart side (like it is on the Java side in this PR); in this case it's net new code for now because we can't remove the generated JSON conversion yet (as noted in the PR description).

class PlatformProduct {
PlatformProduct({required this.productId, required this.productType});
/// Pigeon version of Java QueryProductDetailsParams.Product.
class PlatformQueryProduct {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This rename is because I discovered that there are at least two different things called Product in the Billing Client API surface, so the old name was too generic.


public void setPriceAmountMicros(@NonNull Long setterArg) {
if (setterArg == null) {
throw new IllegalStateException("Nonnull field \"priceAmountMicros\" is null.");
Copy link
Contributor

Choose a reason for hiding this comment

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

setPrinceAmountMicros I think is only called by in plugin java code so this would be a plugin author error. Is that why this is not a PlatfromException?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Pigeon generates these errors for the native classes in Java so that if someone violates their own API constraints in native plugin code it'll create an error on the Java side, where it happened, rather than the Dart side (when it's read) further from the mistake.

@stuartmorgan-g stuartmorgan-g added the autosubmit Merge PR when tree becomes green via auto submit App label Apr 8, 2024
@auto-submit auto-submit bot merged commit 583f8dd into flutter:main Apr 8, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Apr 9, 2024
auto-submit bot pushed a commit to flutter/flutter that referenced this pull request Apr 9, 2024
flutter/packages@6b4d8b6...17f55d3

2024-04-09 [email protected] Release compileSdk changes (flutter/packages#6491)
2024-04-08 [email protected] [camera_android] Remove `TestUtils.java` (flutter/packages#6490)
2024-04-08 [email protected] Roll Flutter from 98d23f7 to 533d04d (12 revisions) (flutter/packages#6488)
2024-04-08 [email protected] [go_router_builder] Add `restorationScopeId` to `ShellRouteData` (flutter/packages#6238)
2024-04-08 [email protected] [go_router] Fixes deep links with no path (flutter/packages#6447)
2024-04-08 [email protected] [in_app_purchase] Convert Android data objects to Pigeon (flutter/packages#6453)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages-flutter-autoroll
Please CC [email protected],[email protected] on the revert to ensure that a human
is aware of the problem.

To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
gilnobrega pushed a commit to gilnobrega/flutter that referenced this pull request Apr 22, 2024
flutter/packages@6b4d8b6...17f55d3

2024-04-09 [email protected] Release compileSdk changes (flutter/packages#6491)
2024-04-08 [email protected] [camera_android] Remove `TestUtils.java` (flutter/packages#6490)
2024-04-08 [email protected] Roll Flutter from 98d23f7 to 533d04d (12 revisions) (flutter/packages#6488)
2024-04-08 [email protected] [go_router_builder] Add `restorationScopeId` to `ShellRouteData` (flutter/packages#6238)
2024-04-08 [email protected] [go_router] Fixes deep links with no path (flutter/packages#6447)
2024-04-08 [email protected] [in_app_purchase] Convert Android data objects to Pigeon (flutter/packages#6453)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages-flutter-autoroll
Please CC [email protected],[email protected] on the revert to ensure that a human
is aware of the problem.

To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
TecHaxter pushed a commit to TecHaxter/flutter_packages that referenced this pull request May 22, 2024
Follow-up to flutter#6262, converting the nested data objects from the legacy JSON conversion to typed Pigeon objects.

Deprecates all the JSON code in the wrapper objects, but does not remove it because, unfortunately, the wrapper objects were both platform data transfer objects *and* the public API surface, so the JSON serialization/deserialization code that was part of those objects for platform channel usage is part of the public API as well. At some point we can do a breaking change to clean up that code (flutter/flutter#146202).

Fixes flutter/flutter#117910
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

autosubmit Merge PR when tree becomes green via auto submit App p: in_app_purchase platform-android

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[in_app_purchase] Convert to Pigeon

2 participants