Skip to content

Integrate FIS into FIAM Headless #1332

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

Merged
merged 6 commits into from
Mar 10, 2020
Merged

Integrate FIS into FIAM Headless #1332

merged 6 commits into from
Mar 10, 2020

Conversation

JasonAHeron
Copy link
Contributor

No description provided.

@googlebot googlebot added the cla: yes Override cla label Mar 9, 2020
@codecov
Copy link

codecov bot commented Mar 9, 2020

Codecov Report

Merging #1332 into master will decrease coverage by 1.15%.
The diff coverage is 66.27%.

Flag Coverage Δ Complexity Δ
#Encoders_FirebaseEncodersJson ? ?
#Encoders_FirebaseEncodersProcessor ? ?
#Encoders_FirebaseEncodersReflective ? ?
#FirebaseAbt ? ?
#FirebaseCommon ? ?
#FirebaseCommon_DataCollectionTests ? ?
#FirebaseCommon_Ktx ? ?
#FirebaseComponents ? ?
#FirebaseConfig ? ?
#FirebaseConfig_Ktx ? ?
#FirebaseCrashlytics ? ?
#FirebaseDatabase ? ?
#FirebaseDatabaseCollection ? ?
#FirebaseDatabase_Ktx ? ?
#FirebaseDatatransport ? ?
#FirebaseDynamicLinks ? ?
#FirebaseDynamicLinks_Ktx ? ?
#FirebaseFirestore ? ?
#FirebaseFirestore_Ktx ? ?
#FirebaseFunctions ? ?
#FirebaseFunctions_Ktx ? ?
#FirebaseInappmessaging 51.51% <66.27%> (+0.35%) 528 <13> (+5) ⬆️
#FirebaseInappmessagingDisplay 34.52% <ø> (ø) 129 <ø> (ø) ⬇️
#FirebaseInappmessagingDisplay_Ktx 100% <ø> (ø) 0 <ø> (ø) ⬇️
#FirebaseInappmessaging_Ktx 100% <ø> (ø) 0 <ø> (ø) ⬇️
#FirebaseInstallations ? ?
#FirebaseSegmentation ? ?
#FirebaseStorage ? ?
#FirebaseStorage_Ktx ? ?
#Tools_Errorprone ? ?
#Tools_Lint ? ?
#Transport_TransportBackendCct ? ?
#Transport_TransportRuntime ? ?

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 32a370b...d8feaba. Read the comment docs.

Copy link
Member

@vkryachko vkryachko left a comment

Choose a reason for hiding this comment

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

Looks like one of the tests is legitimately failing, pls double check

});
return firebaseInstallations
.getId()
.continueWithTask(
Copy link
Member

Choose a reason for hiding this comment

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

Why are you using continueWithTask? do you want to proceed even if this task is cancelled?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

so now I changed it to continueWith and I check both results against null. Am I not handling error cases correctly?

Copy link
Member

Choose a reason for hiding this comment

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

I am actually not sure that null can be returned at all from those tasks, if an error happened getResult() will throw that error so I think it should be fine in terms of error handling.

Subscriber firebaseEventsSubscriber) {
this.sharedPreferencesUtils = sharedPreferencesUtils;
isGlobalAutomaticDataCollectionEnabled =
new AtomicBoolean(firebaseApp.isDataCollectionDefaultEnabled());
if (isAutomaticDataCollectionEnabled()) {
// Trigger this as early as possible, to minimize any latencies on returning the token
Copy link
Member

Choose a reason for hiding this comment

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

Is this no longer desirable? Or did FIS change in a way that makes it a non-issue?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This just felt like a premature optimization and it seemed like this would be a good time to understand if it was actually necessary

Copy link
Member

@vkryachko vkryachko left a comment

Choose a reason for hiding this comment

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

lgtm, you may want to validate your impl with someone on the fis team as well.

});
return firebaseInstallations
.getId()
.continueWithTask(
Copy link
Member

Choose a reason for hiding this comment

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

I am actually not sure that null can be returned at all from those tasks, if an error happened getResult() will throw that error so I think it should be fine in terms of error handling.

@JasonAHeron JasonAHeron merged commit 261ad66 into master Mar 10, 2020
@JasonAHeron JasonAHeron deleted the FIS_PLEASE branch March 10, 2020 21:03
(unused) -> {
String idResult = idTask.getResult();
InstallationTokenResult tokenResult = tokenTask.getResult();
if (tokenResult == null || idResult == null) {
Copy link
Contributor

Choose a reason for hiding this comment

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

None of the tasks will return null. Its on me for not adding the annotations on the APIs. I will update that on my end.

The Tasks would throw exceptions which you might want to handle based on completion state.

}
}

private CampaignAnalytics createEventEntry(InAppMessage message, EventType eventType) {
return createCampaignAnalyticsBuilder(message).setEventType(eventType).build();
private CampaignAnalytics createEventEntry(InAppMessage message, String id, EventType eventType) {
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: call it fid or instanceId to differentiate from any other type of id used in FIAM. Idk if there is one, just think it would avoid any confusion.

@@ -116,17 +116,17 @@ dependencies {
implementation project(':protolite-well-known-types')
implementation project(':transport:transport-api')
implementation project(':firebase-datatransport')
implementation project(':firebase-installations-interop')
Copy link
Contributor

Choose a reason for hiding this comment

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

Wondering if you should depend on the released version vs the HEAD? Idk whats the standard way in firebase.

JasonAHeron added a commit that referenced this pull request Mar 31, 2020
@firebase firebase locked and limited conversation to collaborators Apr 10, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants