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

[Heartbeat Service] Guard against empty heartbeat caches. #7749

Merged
merged 4 commits into from
Nov 7, 2023

Conversation

DellaBitta
Copy link
Contributor

@DellaBitta DellaBitta commented Nov 3, 2023

Discussion

There seems to be a potential scenario in the heartbeat service running in the Opera browser (#7736) that the heartbeatCache exists but it's an empty object. The code implementation encounters errors in these cases as it assumes the heartbeatCache has a heartbeats array. This change better detects these empty object cases and treats them in a similar way as if there's nothing in the heartbeatCache.

Testing

CI

API Changes

None.

Copy link

changeset-bot bot commented Nov 3, 2023

🦋 Changeset detected

Latest commit: e6b709d

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 3 packages
Name Type
@firebase/app Patch
@firebase/app-compat Patch
firebase Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@google-oss-bot
Copy link
Contributor

google-oss-bot commented Nov 3, 2023

Size Report 1

Affected Products

  • @firebase/app

    TypeBase (ff1a6ec)Merge (8aca8fb)Diff
    browser14.4 kB14.5 kB+108 B (+0.8%)
    esm518.9 kB19.0 kB+108 B (+0.6%)
    main19.8 kB19.9 kB+108 B (+0.5%)
    module14.4 kB14.5 kB+108 B (+0.8%)
  • bundle

    43 size changes

    TypeBase (ff1a6ec)Merge (8aca8fb)Diff
    analytics (logEvent)43.8 kB43.9 kB+100 B (+0.2%)
    app-check (CustomProvider)36.6 kB36.7 kB+100 B (+0.3%)
    app-check (ReCaptchaEnterpriseProvider)39.1 kB39.2 kB+100 B (+0.3%)
    app-check (ReCaptchaV3Provider)39.1 kB39.2 kB+100 B (+0.3%)
    auth (Anonymous)73.1 kB73.2 kB+100 B (+0.1%)
    auth (EmailAndPassword)80.9 kB81.0 kB+100 B (+0.1%)
    auth (GoogleFBTwitterGitHubPopup)99.7 kB99.8 kB+100 B (+0.1%)
    auth (GooglePopup)97.0 kB97.1 kB+100 B (+0.1%)
    auth (GoogleRedirect)97.2 kB97.3 kB+100 B (+0.1%)
    auth (Phone)83.3 kB83.4 kB+100 B (+0.1%)
    database (Append to a list of data)148 kB148 kB+100 B (+0.1%)
    database (Filtering data)147 kB147 kB+100 B (+0.1%)
    database (Listen for child events)164 kB164 kB+100 B (+0.1%)
    database (Listen for value events + Detach listeners)164 kB164 kB+100 B (+0.1%)
    database (Listen for value events)163 kB164 kB+100 B (+0.1%)
    database (Read data once)163 kB163 kB+100 B (+0.1%)
    database (Save data as transactions)166 kB166 kB+100 B (+0.1%)
    database (Sort data)149 kB149 kB+100 B (+0.1%)
    database (Write data)147 kB148 kB+100 B (+0.1%)
    firestore (Persistence)302 kB302 kB+100 B (+0.0%)
    firestore (Query Cursors)238 kB238 kB+100 B (+0.0%)
    firestore (Query)236 kB236 kB+100 B (+0.0%)
    firestore (Read data once)224 kB224 kB+100 B (+0.0%)
    firestore (Realtime updates)226 kB226 kB+100 B (+0.0%)
    firestore (Transaction)204 kB204 kB+100 B (+0.0%)
    firestore (Write data)204 kB204 kB+100 B (+0.0%)
    firestore-lite (Query Cursors)88.8 kB88.9 kB+100 B (+0.1%)
    firestore-lite (Query)85.0 kB85.1 kB+100 B (+0.1%)
    firestore-lite (Read data once)61.3 kB61.4 kB+100 B (+0.2%)
    firestore-lite (Transaction)86.2 kB86.3 kB+100 B (+0.1%)
    firestore-lite (Write data)70.9 kB71.0 kB+100 B (+0.1%)
    functions (call)31.2 kB31.3 kB+100 B (+0.3%)
    messaging (send + receive)46.5 kB46.6 kB+100 B (+0.2%)
    performance (trace)51.0 kB51.1 kB+100 B (+0.2%)
    remote-config (getAndFetch)45.5 kB45.6 kB+100 B (+0.2%)
    storage (getBytes)41.3 kB41.4 kB+100 B (+0.2%)
    storage (getDownloadURL)43.4 kB43.5 kB+100 B (+0.2%)
    storage (getMetadata)42.8 kB42.9 kB+100 B (+0.2%)
    storage (list + listAll)42.2 kB42.3 kB+100 B (+0.2%)
    storage (updateMetadata)43.1 kB43.2 kB+100 B (+0.2%)
    storage (uploadBytes)48.2 kB48.3 kB+100 B (+0.2%)
    storage (uploadBytesResumable)58.1 kB58.2 kB+100 B (+0.2%)
    storage (uploadString)48.4 kB48.5 kB+100 B (+0.2%)

  • firebase

    TypeBase (ff1a6ec)Merge (8aca8fb)Diff
    firebase-app-compat.js28.9 kB29.0 kB+94 B (+0.3%)
    firebase-app.js93.4 kB93.5 kB+152 B (+0.2%)
    firebase-compat.js778 kB778 kB+94 B (+0.0%)
    firebase-performance-standalone-compat.es2017.js90.1 kB90.2 kB+100 B (+0.1%)
    firebase-performance-standalone-compat.js67.3 kB67.4 kB+100 B (+0.1%)

Test Logs

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

@google-oss-bot
Copy link
Contributor

google-oss-bot commented Nov 3, 2023

Size Analysis Report 1

This report is too large (140,720 characters) to be displayed here in a GitHub comment. Please use the below link to see the full report on Google Cloud Storage.

Test Logs

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

@DellaBitta DellaBitta marked this pull request as ready for review November 6, 2023 16:54
@DellaBitta DellaBitta requested review from a team as code owners November 6, 2023 16:54
.changeset/chilly-emus-sit.md Outdated Show resolved Hide resolved
@DellaBitta DellaBitta merged commit 5c7fa84 into master Nov 7, 2023
43 checks passed
@DellaBitta DellaBitta deleted the ddb-empty-heartbeats branch November 7, 2023 01:24
@google-oss-bot google-oss-bot mentioned this pull request Nov 7, 2023
prameshj pushed a commit that referenced this pull request Nov 13, 2023
There seems to be a potential scenario in the heartbeat service running in the Opera browser (#7736) that the heartbeatCache exists but it's an empty object. The code implementation encounters errors in these cases as it assumes the heartbeatCache has a heartbeats array. This change better detects these empty object cases and treats them in a similar way as if there's nothing in the heartbeatCache.
@firebase firebase locked and limited conversation to collaborators Dec 7, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants