Skip to content
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

Finish background FCM broadcasts after handling the message. #5142

Merged
merged 1 commit into from
Jul 10, 2023

Conversation

gsakakihara
Copy link
Contributor

  • Changed to finish a background broadcast after the message has been handled, subject to a timeout. This keeps the FirebaseMessagingService's process in an active state while it is handling an FCM message, up to the 20 seconds allowed.
  • Removed acquiring a WakeLock for background broadcasts as one is held for the app until the broadcast is finished.

* Changed to finish a background broadcast after the message has been handled, subject to a timeout. This keeps the `FirebaseMessagingService`'s process in an active state while it is handling an FCM message, up to the 20 seconds allowed.
* Removed acquiring a WakeLock for background broadcasts as one is held for the app until the broadcast is finished.
@github-actions
Copy link
Contributor

github-actions bot commented Jul 6, 2023

Release note changes

The following release notes were modified. Please ensure they look correct.

Release Notes
firebase-messaging
### {{messaging_longer}} version 23.1.3 {: #messaging_v23-1-3}

* {{deprecated}} Deprecated FCM upstream messaging. See the
  [FAQ](https://firebase.google.com/support/faq#fcm-23-deprecation) for more
  details.

* {{changed}} Changed to finish a background broadcast after the message has been
  handled, subject to a timeout. This keeps the `FirebaseMessagingService`'s
  process in an active state while it is handling an FCM message, up to the
  20 seconds allowed.

#### {{messaging_longer}} Kotlin extensions version 23.1.3 {: #messaging-ktx_v23-1-3}

The Kotlin extensions library transitively includes the updated
`firebase-messaging` library. The Kotlin extensions library has no additional
updates.

@google-oss-bot
Copy link
Contributor

Coverage Report 1

Affected Products

  • firebase-messaging

    Overall coverage changed from ? (bf8cb54) to 84.25% (d1d774b) by ?.

    41 individual files with coverage change

    FilenameBase (bf8cb54)Merge (d1d774b)Diff
    AutoProtoEncoderDoNotUseEncoder.java?98.17%?
    ByteStreams.java?59.72%?
    CommonNotificationBuilder.java?90.78%?
    Constants.java?92.86%?
    DisplayNotification.java?91.38%?
    EnhancedIntentService.java?76.60%?
    ExecutorFactory.java?0.00%?
    FcmBroadcastProcessor.java?94.34%?
    FcmExecutors.java?80.00%?
    FcmLifecycleCallbacks.java?89.29%?
    FirebaseInstanceIdReceiver.java?72.73%?
    FirebaseMessaging.java?73.57%?
    FirebaseMessagingRegistrar.java?100.00%?
    FirebaseMessagingService.java?94.03%?
    GmsRpc.java?83.15%?
    ImageDownload.java?93.33%?
    MessagingAnalytics.java?81.78%?
    MessagingClientEvent.java?93.58%?
    MessagingClientEventExtension.java?76.47%?
    Metadata.java?41.27%?
    NotificationParams.java?98.71%?
    PoolableExecutors.java?29.17%?
    ProtoEncoderDoNotUse.java?50.00%?
    ProxyNotificationInitializer.java?93.75%?
    ProxyNotificationPreferences.java?88.89%?
    RemoteMessage.java?95.48%?
    RemoteMessageCreator.java?88.89%?
    RequestDeduplicator.java?80.00%?
    SendException.java?100.00%?
    ServiceStarter.java?87.50%?
    SharedPreferencesQueue.java?98.65%?
    Store.java?74.19%?
    SyncTask.java?70.83%?
    ThreadPriority.java?100.00%?
    TopicOperation.java?73.33%?
    TopicsStore.java?100.00%?
    TopicsSubscriber.java?88.60%?
    TopicsSyncTask.java?49.33%?
    WakeLockHolder.java?95.92%?
    WithinAppServiceBinder.java?90.91%?
    WithinAppServiceConnection.java?85.00%?

Test Logs

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

@github-actions
Copy link
Contributor

github-actions bot commented Jul 6, 2023

Unit Test Results

  54 files  ±0    54 suites  ±0   6m 58s ⏱️ +6s
470 tests ±0  470 ✔️ ±0  0 💤 ±0  0 ±0 
940 runs  ±0  940 ✔️ ±0  0 💤 ±0  0 ±0 

Results for commit 00bc602. ± Comparison against base commit bf8cb54.

This pull request removes 3 and adds 3 tests. Note that renamed tests count towards both.
com.google.firebase.messaging.FcmBroadcastProcessorRoboTest ‑ testStartMessagingService_NormalPriorityBackgroundCheck
com.google.firebase.messaging.FcmBroadcastProcessorRoboTest ‑ testStartMessagingService_bindNoWakeLockPermission
com.google.firebase.messaging.WithinAppServiceConnectionRoboTest ‑ testReceiverTimesOut_ForegroundBroadcast
com.google.firebase.messaging.FcmBroadcastProcessorRoboTest ‑ testStartMessagingService_Background
com.google.firebase.messaging.FcmBroadcastProcessorRoboTest ‑ testStartMessagingService_ForegroundBindNoWakeLock
com.google.firebase.messaging.FcmBroadcastProcessorRoboTest ‑ testStartMessagingService_ForegroundBindWithWakeLock

@google-oss-bot
Copy link
Contributor

Size Report 1

Affected Products

  • firebase-messaging

    TypeBase (bf8cb54)Merge (d1d774b)Diff
    aar142 kB142 kB+52 B (+0.0%)
    apk (aggressive)465 kB465 kB+68 B (+0.0%)
    apk (release)1.72 MB1.72 MB+468 B (+0.0%)

Test Logs

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

@google-oss-bot
Copy link
Contributor

Startup Time Report 1

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

Notes

Startup Times

  • fire-fcm

    DeviceStatisticsDistributions
    oriole-32
    Percentilebf8cb54d1d774bDiffSignificant (?)
    p101.19 ±1 ms1.19 ±1 ms-2.16 μs (-0.2%)NO
    p251.27 ±1 ms1.28 ±1 ms+14.2 μs (+1.1%)NO
    p501.42 ±1 ms1.43 ±2 ms+12.7 μs (+0.9%)NO
    p751.64 ±2 ms1.66 ±2 ms+17.3 μs (+1.1%)NO
    p901.95 ±2 ms2.04 ±2 ms+91.3 μs (+4.7%)NO

    20 test runs in comparison
    CommitTest Runs
    bf8cb54
    • 2023-07-06_17:20:40.664081_eWEQ
    • 2023-07-06_17:20:40.668411_mlIK
    • 2023-07-06_17:20:40.668435_GUMY
    • 2023-07-06_17:20:40.668445_CrbJ
    • 2023-07-06_17:20:40.668452_wkLc
    • 2023-07-06_17:20:40.668460_gcsa
    • 2023-07-06_17:20:40.668467_lSkQ
    • 2023-07-06_17:20:40.668474_kAnM
    • 2023-07-06_17:20:40.668481_sRlB
    • 2023-07-06_17:20:40.668489_nURq
    d1d774b
    • 2023-07-06_17:46:03.646856_lfCj
    • 2023-07-06_17:46:03.651006_nwSY
    • 2023-07-06_17:46:03.651020_cKFE
    • 2023-07-06_17:46:03.651029_Cgam
    • 2023-07-06_17:46:03.651035_VxLh
    • 2023-07-06_17:46:03.651042_cJhS
    • 2023-07-06_17:46:03.651054_mZUG
    • 2023-07-06_17:46:03.651061_Caau
    • 2023-07-06_17:46:03.651067_IRan
    • 2023-07-06_17:46:03.651073_OeQj
    redfin-30
    Percentilebf8cb54d1d774bDiffSignificant (?)
    p104.30 ±4 ms1.36 ±0.8 ms-2.94 ms (-68.4%)NO
    p254.72 ±4 ms1.47 ±0.9 ms-3.25 ms (-68.9%)NO
    p505.55 ±5 ms1.67 ±1 ms-3.88 ms (-69.9%)NO
    p756.82 ±6 ms2.07 ±1 ms-4.76 ms (-69.7%)NO
    p908.68 ±8 ms2.82 ±2 ms-5.86 ms (-67.5%)NO

    20 test runs in comparison
    CommitTest Runs
    bf8cb54
    • 2023-07-06_17:20:40.664081_eWEQ
    • 2023-07-06_17:20:40.668411_mlIK
    • 2023-07-06_17:20:40.668435_GUMY
    • 2023-07-06_17:20:40.668445_CrbJ
    • 2023-07-06_17:20:40.668452_wkLc
    • 2023-07-06_17:20:40.668460_gcsa
    • 2023-07-06_17:20:40.668467_lSkQ
    • 2023-07-06_17:20:40.668474_kAnM
    • 2023-07-06_17:20:40.668481_sRlB
    • 2023-07-06_17:20:40.668489_nURq
    d1d774b
    • 2023-07-06_17:46:03.646856_lfCj
    • 2023-07-06_17:46:03.651006_nwSY
    • 2023-07-06_17:46:03.651020_cKFE
    • 2023-07-06_17:46:03.651029_Cgam
    • 2023-07-06_17:46:03.651035_VxLh
    • 2023-07-06_17:46:03.651042_cJhS
    • 2023-07-06_17:46:03.651054_mZUG
    • 2023-07-06_17:46:03.651061_Caau
    • 2023-07-06_17:46:03.651067_IRan
    • 2023-07-06_17:46:03.651073_OeQj
  • timeToInitialDisplay

    DeviceStatisticsDistributions
    oriole-32
    Percentilebf8cb54d1d774bDiffSignificant (?)
    p10200 ±4 ms207 ±5 ms+7.48 ms (+3.7%)NO
    p25206 ±5 ms214 ±5 ms+8.05 ms (+3.9%)NO
    p50213 ±5 ms222 ±5 ms+9.01 ms (+4.2%)NO
    p75221 ±4 ms233 ±6 ms+12.5 ms (+5.7%)NO
    p90229 ±5 ms249 ±9.9 ms+20.6 ms (+9.0%)NO

    20 test runs in comparison
    CommitTest Runs
    bf8cb54
    • 2023-07-06_17:20:40.664081_eWEQ
    • 2023-07-06_17:20:40.668411_mlIK
    • 2023-07-06_17:20:40.668435_GUMY
    • 2023-07-06_17:20:40.668445_CrbJ
    • 2023-07-06_17:20:40.668452_wkLc
    • 2023-07-06_17:20:40.668460_gcsa
    • 2023-07-06_17:20:40.668467_lSkQ
    • 2023-07-06_17:20:40.668474_kAnM
    • 2023-07-06_17:20:40.668481_sRlB
    • 2023-07-06_17:20:40.668489_nURq
    d1d774b
    • 2023-07-06_17:46:03.646856_lfCj
    • 2023-07-06_17:46:03.651006_nwSY
    • 2023-07-06_17:46:03.651020_cKFE
    • 2023-07-06_17:46:03.651029_Cgam
    • 2023-07-06_17:46:03.651035_VxLh
    • 2023-07-06_17:46:03.651042_cJhS
    • 2023-07-06_17:46:03.651054_mZUG
    • 2023-07-06_17:46:03.651061_Caau
    • 2023-07-06_17:46:03.651067_IRan
    • 2023-07-06_17:46:03.651073_OeQj
    redfin-30
    Percentilebf8cb54d1d774bDiffSignificant (?)
    p10243 ±3 ms266 ±2 ms+23.2 ms (+9.6%)YES
    p25250 ±3 ms273 ±3 ms+22.8 ms (+9.1%)YES
    p50257 ±4 ms280 ±3 ms+23.5 ms (+9.1%)YES
    p75266 ±5 ms289 ±3 ms+23.7 ms (+8.9%)YES
    p90277 ±6 ms301 ±6 ms+24.3 ms (+8.8%)MAYBE

    20 test runs in comparison
    CommitTest Runs
    bf8cb54
    • 2023-07-06_17:20:40.664081_eWEQ
    • 2023-07-06_17:20:40.668411_mlIK
    • 2023-07-06_17:20:40.668435_GUMY
    • 2023-07-06_17:20:40.668445_CrbJ
    • 2023-07-06_17:20:40.668452_wkLc
    • 2023-07-06_17:20:40.668460_gcsa
    • 2023-07-06_17:20:40.668467_lSkQ
    • 2023-07-06_17:20:40.668474_kAnM
    • 2023-07-06_17:20:40.668481_sRlB
    • 2023-07-06_17:20:40.668489_nURq
    d1d774b
    • 2023-07-06_17:46:03.646856_lfCj
    • 2023-07-06_17:46:03.651006_nwSY
    • 2023-07-06_17:46:03.651020_cKFE
    • 2023-07-06_17:46:03.651029_Cgam
    • 2023-07-06_17:46:03.651035_VxLh
    • 2023-07-06_17:46:03.651042_cJhS
    • 2023-07-06_17:46:03.651054_mZUG
    • 2023-07-06_17:46:03.651061_Caau
    • 2023-07-06_17:46:03.651067_IRan
    • 2023-07-06_17:46:03.651073_OeQj

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

@gsakakihara gsakakihara merged commit 8fff029 into master Jul 10, 2023
@gsakakihara gsakakihara deleted the gsakakihara/finish_background_broadcast branch July 10, 2023 18:14
@firebase firebase locked and limited conversation to collaborators Aug 10, 2023
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.

3 participants