Skip to content

Conversation

@ryanwilson
Copy link
Member

This shouldn't have been added - the component registration system can
provide proper configuration instead of relying on a static
configureWithApp: call. Many of the SDKs relied on singletons being
available there, which wasn't necessary. Instead, this should happen
in the component creation block and use the instantiationTiming
parameter on registerInternalLibrary

@ryanwilson ryanwilson marked this pull request as ready for review July 12, 2019 15:25
/// Implement this method if the library needs notifications for lifecycle events. This method is
/// called when the developer calls `FirebaseApp.configure()`.
+ (void)configureWithApp:(FIRApp *)app;
+ (void)configureWithApp:(FIRApp *)app
Copy link
Member Author

Choose a reason for hiding this comment

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

I'm fairly certain this isn't used anymore, but we can leave it for a release or two just to be sure.

Copy link
Member

Choose a reason for hiding this comment

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

Technically, if Firebase 6 pods use it, it should not be deleted until Firebase 7.

Copy link
Member Author

Choose a reason for hiding this comment

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

Makes sense, that's fine with me :)

Copy link
Member

Choose a reason for hiding this comment

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

Maybe it should be deleted since the implementation is gone. Also looks like all usages are in this repo.

Copy link
Member Author

Choose a reason for hiding this comment

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

All usages are in this repo, sure, but we still call it on any SDKs that register and implement that method. (in +[FIRApp sendNotificationToSDKs:]). I think it makes sense to keep it around until next breaking change just in case folks get a new Core SDK with an older SDK that still depends on it.

/// Implement this method if the library needs notifications for lifecycle events. This method is
/// called when the developer calls `FirebaseApp.configure()`.
+ (void)configureWithApp:(FIRApp *)app;
+ (void)configureWithApp:(FIRApp *)app
Copy link
Member

Choose a reason for hiding this comment

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

Maybe it should be deleted since the implementation is gone. Also looks like all usages are in this repo.

@ryanwilson ryanwilson added this to the M53 milestone Jul 15, 2019
@ryanwilson
Copy link
Member Author

Waiting to land this until after the M52 release branch is cut.

@ryanwilson ryanwilson removed this from the 6.6.0 milestone Jul 31, 2019
@paulb777
Copy link
Member

Test webhook to icore chat

This shouldn't have been added - the component registration system can
provide proper configuration instead of relying on a static
`configureWithApp:` call. Many of the SDKs relied on singletons being
available there, which wasn't necessary. Instead, this should happen
in the component creation block and use the `instantiationTiming`
parameter on `registerInternalLibrary`
This will now wait until all components have been added to the container
before instantiating components. This hasn't been an issue in the past
but could have caused issues if components weren't registered in the
array yet.
@ryanwilson
Copy link
Member Author

Rebased onto master, will merge once Travis is green again.

@ryanwilson
Copy link
Member Author

Update: this is still relevant, but FIAM needs some changes. It's a non-trivial lifecycle change, will need some planning. cc @christibbs

ryanwilson added a commit that referenced this pull request Oct 9, 2019
The container instantiation could happen at the wrong time, before all
components have been added to the container. This fixes it, and also
moves IID to use the proper instantiation timing instead of relying on
the `configureWithApp:` call. This is part continuation of #3147, where
I'll be fixing the rest of the SDKs in follow up PRs.
ryanwilson added a commit that referenced this pull request Oct 11, 2019
* Fix container instantiation timing, IID startup.

The container instantiation could happen at the wrong time, before all
components have been added to the container. This fixes it, and also
moves IID to use the proper instantiation timing instead of relying on
the `configureWithApp:` call. This is part continuation of #3147, where
I'll be fixing the rest of the SDKs in follow up PRs.

* Typo

* Further work on instantiation timing.

This moves the instantiation of components to after the FirebaseApp is
completely configured and assigned, as it should be. This also exposed
a recursive issue with IID calling the Messaging singleton, which in
turn called IID and instantiated multiple instances.

A change was made to break the cycle: the Messaging `isAutoInitEnabled`
call was changed to a static method vs an instance method, allowing IID
to call it during initialization without instantiating the Messaging
instance (since it doesn't have a direct dependency on it).

* Revert unintentional formatting of entire FIRMessaging file.

* Fix tests.

* Format InstanceID.m

* Remove unused import.

* Fix ComponentContainer test.

* Minor PR feedback.
@ryanwilson
Copy link
Member Author

Closed in favour of #4137

@ryanwilson ryanwilson closed this Oct 22, 2019
@firebase firebase locked and limited conversation to collaborators Nov 22, 2019
@paulb777 paulb777 deleted the rw-core-fix branch July 8, 2020 23:59
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants