Skip to content

Fix NPE when no version name is set #5198

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 5 commits into from
Jul 26, 2023
Merged

Conversation

mrober
Copy link
Contributor

@mrober mrober commented Jul 26, 2023

Fix NPE when no version name is set. This will make it easier for apps to have Android tests while including the Sessions SDK. Also removed references to ApplicationInfoFlags to make it easier to minify apps with older api levels.

When the version name is unset, use the version code.

@github-actions
Copy link
Contributor

github-actions bot commented Jul 26, 2023

Release note changes

The following had changelogs that were modified, but did not have any unreleased entries for release notes to generate from.

Changelogs

firebase-sessions

@mrober mrober requested a review from samedson July 26, 2023 14:54
@mrober
Copy link
Contributor Author

mrober commented Jul 26, 2023

#5195

@google-oss-bot
Copy link
Contributor

google-oss-bot commented Jul 26, 2023

Coverage Report 1

Affected Products

  • firebase-sessions

    Overall coverage changed from ? (24d1983) to 75.99% (883683c) by ?.

    20 individual files with coverage change

    FilenameBase (24d1983)Merge (883683c)Diff
    ApplicationInfo.kt?100.00%?
    AutoSessionEventEncoder.java?100.00%?
    EventGDTLogger.kt?75.00%?
    FirebaseSessions.kt?0.00%?
    FirebaseSessionsDependencies.kt?91.30%?
    FirebaseSessionsRegistrar.kt?76.00%?
    LocalOverrideSettings.kt?100.00%?
    RemoteSettings.kt?88.06%?
    RemoteSettingsFetcher.kt?65.85%?
    SessionCoordinator.kt?75.00%?
    SessionEvent.kt?100.00%?
    SessionEvents.kt?97.06%?
    SessionGenerator.kt?91.67%?
    SessionInitiateListener.kt?0.00%?
    SessionInitiator.kt?74.19%?
    SessionsSettings.kt?70.45%?
    SessionSubscriber.kt?75.00%?
    SettingsCache.kt?94.83%?
    SettingsProvider.kt?50.00%?
    Time.kt?0.00%?

Test Logs

  1. https://storage.googleapis.com/firebase-sdk-metric-reports/BCK8Inv1Yq.html

@github-actions
Copy link
Contributor

github-actions bot commented Jul 26, 2023

Unit Test Results

   128 files  +     88     128 suites  +88   3m 39s ⏱️ + 1m 12s
1 029 tests +   830  1 029 ✔️ +   831  0 💤  - 1  0 ±0 
2 058 runs  +1 660  2 058 ✔️ +1 662  0 💤  - 2  0 ±0 

Results for commit f6999e6. ± Comparison against base commit fc5cde4.

This pull request removes 199 and adds 1029 tests. Note that renamed tests count towards both.
com.google.firebase.inappmessaging.display.FirebaseInAppMessagingDisplayTest ‑ dismissClickListener_dismissesFiam
com.google.firebase.inappmessaging.display.FirebaseInAppMessagingDisplayTest ‑ dismissTimer_onComplete_dismissesFiam
com.google.firebase.inappmessaging.display.FirebaseInAppMessagingDisplayTest ‑ fiamClickListener_whenActionUrlProvided_andBrowserAvailable_opensBrowserIntent
com.google.firebase.inappmessaging.display.FirebaseInAppMessagingDisplayTest ‑ fiamClickListener_whenActionUrlProvided_andChromeAvailable_opensCustomTab
com.google.firebase.inappmessaging.display.FirebaseInAppMessagingDisplayTest ‑ fiamUIListener_whenFiamClicked_receivesOnFiamClick
com.google.firebase.inappmessaging.display.FirebaseInAppMessagingDisplayTest ‑ firebaseInAppMessagingUIListener_whenFiamRendered_receivesOnFiamTrigger
com.google.firebase.inappmessaging.display.FirebaseInAppMessagingDisplayTest ‑ impressionTimer_onComplete_firesImpressionLogAction
com.google.firebase.inappmessaging.display.FirebaseInAppMessagingDisplayTest ‑ inflate_setsActionListenerToDismissFiamOnClick
com.google.firebase.inappmessaging.display.FirebaseInAppMessagingDisplayTest ‑ onActivitPaused_clearsListeners
com.google.firebase.inappmessaging.display.FirebaseInAppMessagingDisplayTest ‑ onActivityNewActivityStarted_displaysFiamInNewActivity
…
com.google.firebase.crashlytics.internal.common.CrashlyticsControllerRobolectricTest ‑ testDoCloseSession_disabledAnrs_doesNotPersistsAppExitInfo
com.google.firebase.crashlytics.internal.common.CrashlyticsControllerRobolectricTest ‑ testDoCloseSession_enabledAnrs_doesNotPersistsAppExitInfoIfItDoesntExist
com.google.firebase.crashlytics.internal.common.CrashlyticsControllerRobolectricTest ‑ testDoCloseSession_enabledAnrs_persistsAppExitInfoIfItExists
com.google.firebase.crashlytics.internal.common.SessionReportingCoordinatorRobolectricTest ‑ testAppExitInfoEvent_notPersistIfAnrBeforeSession
com.google.firebase.crashlytics.internal.common.SessionReportingCoordinatorRobolectricTest ‑ testAppExitInfoEvent_notPersistIfAppExitInfoNotAnrButWithinSession
com.google.firebase.crashlytics.internal.common.SessionReportingCoordinatorRobolectricTest ‑ testAppExitInfoEvent_persistIfAnrWithinSession
com.google.firebase.crashlytics.internal.common.SessionReportingCoordinatorRobolectricTest ‑ testAppExitInfoEvent_persistIfAnrWithinSession_multipleAppExitInfo
com.google.firebase.crashlytics.internal.common.SessionReportingCoordinatorRobolectricTest ‑ testconvertInputStreamToString_worksSuccessfully
com.google.firebase.crashlytics.internal.model.CrashlyticsReportTest ‑ testGetBinaryImageUuidUtf8Bytes_returnsNullWhenUuidIsNull
com.google.firebase.crashlytics.internal.model.CrashlyticsReportTest ‑ testGetBinaryImageUuidUtf8Bytes_returnsProperBytes
…

♻️ This comment has been updated with latest results.

@google-oss-bot
Copy link
Contributor

google-oss-bot commented Jul 26, 2023

Size Report 1

Affected Products

  • firebase-sessions

    TypeBase (24d1983)Merge (883683c)Diff
    aar107 kB107 kB-91 B (-0.1%)
    apk (aggressive)364 kB364 kB-56 B (-0.0%)
    apk (release)2.06 MB2.06 MB-328 B (-0.0%)

Test Logs

  1. https://storage.googleapis.com/firebase-sdk-metric-reports/QhwhQNGu4r.html

@google-oss-bot
Copy link
Contributor

google-oss-bot commented Jul 26, 2023

Startup Time Report 1

Note: Layout is sometimes suboptimal due to limited formatting support on GitHub. Please check this report on GCS.

Startup time comparison between the CI merge commit (883683c) and the base commit (24d1983) are not available.

No macrobenchmark data found for the base commit (24d1983). Analysis for the CI merge commit (883683c) can be found at:

  1. https://storage.googleapis.com/firebase-sdk-metric-reports/37AEUC4O3J/index.html

@mrober mrober changed the title Fix NPE when no version code is set Fix NPE when no version name is set Jul 26, 2023
Copy link
Contributor

@visumickey visumickey left a comment

Choose a reason for hiding this comment

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

Generally fine with the changes. But one thing to confirm before landing this PR. We need to make sure that the play store prevents submitting apps without version_name. As long as the impact is only with the tests scenario, this change looks good to me.

@mrober
Copy link
Contributor Author

mrober commented Jul 26, 2023

Generally fine with the changes. But one thing to confirm before landing this PR. We need to make sure that the play store prevents submitting apps without version_name. As long as the impact is only with the tests scenario, this change looks good to me.

Yes you have to set both versionCode and versionName for Play Store https://developer.android.com/studio/publish/versioning#versioningsettings and the versionCode cannot be reused.

@mrober mrober enabled auto-merge (squash) July 26, 2023 22:08
@mrober mrober merged commit 3d3eeaf into master Jul 26, 2023
@mrober mrober deleted the sessions-fixnpeinkotlinew branch July 26, 2023 22:13
davidmotson pushed a commit that referenced this pull request Aug 3, 2023
* Fix NPE when no version code is set

* Update changelog

* Simplify the null check

* name

* Add issue to changelog
@firebase firebase locked and limited conversation to collaborators Aug 26, 2023
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