-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
🐛 [firebase_core] Generated Pigeon code is spanning packages #11685
Comments
/cc @Lyokone and @russellwheatley |
Hey @stuartmorgan, thank you for the heads up. I think at a minimum, we will pin the version as you've recommended. We're going to discuss the implications in respect to the Pigeon implementations across packages. The |
But not a pinned one, which means that:
unless that versioning system includes a guarantee that you make a major version change when updating Pigeon-generated code, you cannot ensure that.
Do your integration tests run with every possible combination of versions that the resolver allows? In my experience, most CI systems just test the latest version of everything. That means that you would notice if you updated the Dart generated code without updating the native generated code, but not if you published that as a non-breaking change, at which point your plugin's clients are not protected from the scenario where they use the latest version of To give a concrete example since this can be hard to reason about in the abstract:
Imagine someone updates Pigeon to 11.x—which is not compatible with 9.x—and then regenerates everything, releasing it as a new minor version, instead of major version. There would be:
That will pass any CI that doesn't do very specific things designed for edge cases like this (such as |
(Also, presumably the plugin is federated in order to allow for other implementations that aren't maintained by this organization. By making the Dart code part of the platform interface package, the implication is that other packages could use it as well, but in practice they can't unless you only change the generated code in major version updates because they would be completely broken by |
Given the outlined dilemma above, we're going to pin the platform interface package version to the relevant packages that depend upon it. In our case, the platform interface packages are for the use of FlutterFire. They were not designed to be consumed by other users. |
The sole purpose of the federated plugin design is to allow federation. Why does the platform interface package exist if not to allow other implementations? (I'm confused why the proposed solution here is not to simply move the Dart code for the Pigeon implementation into the other package, which would completely solve this problem without abandoning federation, and also be less complex.) |
I came across this code today, where Pigeon is being configured to generate Dart into
firebase_core_platform_interface
, and native code intofirebase_core
. This is extremely dangerous, particularly given that Pigeon isn't being pinned.The channel details are considered internal implementation details of Pigeon, and subject to change at any time, without breaking version changes. This is not theoretical; for example 4.2.12 completely changed the serialization format of objects, and 10.1.4 changed the names of the channels.
The way this package has been set up, any change to the version of Pigeon used to generate the code for these two packages would have to be versioned as a breaking change to
firebase_core_platform_interface
. If that's really the behavior you want, I would very strongly recommend that you pinpigeon
in your pubspec.yaml and put a very clear warning in a comment on that line. But bigger picture, I would strongly urge you not to use this structure in the first place; putting two halves of a protocol that must exactly match and that you don't directly control in two different packages is very fragile, and likely to cause bugs in the future.The text was updated successfully, but these errors were encountered: