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

[Storage] Cleared timeouts upon pause/resume of uploads #6667

Merged
merged 8 commits into from
Oct 12, 2022

Conversation

maneesht
Copy link
Contributor

@maneesht maneesht commented Oct 8, 2022

Made sure that timers are cleaned up when in the middle of exponential backoff.

@changeset-bot
Copy link

changeset-bot bot commented Oct 8, 2022

🦋 Changeset detected

Latest commit: 3cac155

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

This PR includes changesets to release 3 packages
Name Type
@firebase/storage Patch
firebase Patch
@firebase/storage-compat 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 Oct 8, 2022

Size Report 1

Affected Products

  • @firebase/analytics

    TypeBase (29d0340)Merge (75779cd)Diff
    browser20.1 kB20.2 kB+59 B (+0.3%)
    esm524.7 kB24.8 kB+59 B (+0.2%)
    main26.0 kB26.1 kB+59 B (+0.2%)
    module20.1 kB20.2 kB+59 B (+0.3%)
  • @firebase/database

    TypeBase (29d0340)Merge (75779cd)Diff
    browser248 kB248 kB-62 B (-0.0%)
    esm5276 kB276 kB-49 B (-0.0%)
    main281 kB281 kB-54 B (-0.0%)
    module248 kB248 kB-62 B (-0.0%)
  • @firebase/firestore

    TypeBase (29d0340)Merge (75779cd)Diff
    browser266 kB266 kB-18 B (-0.0%)
    main531 kB531 kB-76 B (-0.0%)
    module266 kB266 kB-18 B (-0.0%)
    react-native266 kB266 kB-18 B (-0.0%)
  • @firebase/firestore-compat

    TypeBase (29d0340)Merge (75779cd)Diff
    browser20.5 kB20.5 kB-1 B (-0.0%)
    esm527.6 kB27.6 kB-1 B (-0.0%)
    main20.9 kB20.9 kB-1 B (-0.0%)
    module20.5 kB20.5 kB-1 B (-0.0%)
    react-native20.5 kB20.5 kB-1 B (-0.0%)
  • @firebase/firestore-lite

    TypeBase (29d0340)Merge (75779cd)Diff
    browser82.2 kB82.2 kB-18 B (-0.0%)
    main139 kB139 kB-76 B (-0.1%)
    module82.2 kB82.2 kB-18 B (-0.0%)
    react-native82.4 kB82.4 kB-18 B (-0.0%)
  • @firebase/functions

    TypeBase (29d0340)Merge (75779cd)Diff
    browser9.62 kB9.55 kB-65 B (-0.7%)
    esm511.7 kB11.7 kB-36 B (-0.3%)
    main12.6 kB12.5 kB-55 B (-0.4%)
    module9.62 kB9.55 kB-65 B (-0.7%)
  • @firebase/storage

    TypeBase (29d0340)Merge (75779cd)Diff
    browser55.6 kB55.6 kB+35 B (+0.1%)
    esm561.8 kB61.9 kB+51 B (+0.1%)
    main58.4 kB58.5 kB+24 B (+0.0%)
    module55.6 kB55.6 kB+35 B (+0.1%)
  • @firebase/util

    TypeBase (29d0340)Merge (75779cd)Diff
    browser22.0 kB22.6 kB+511 B (+2.3%)
    esm523.4 kB24.0 kB+512 B (+2.2%)
    main28.8 kB29.5 kB+674 B (+2.3%)
    module22.0 kB22.6 kB+511 B (+2.3%)
  • bundle

    31 size changes

    TypeBase (29d0340)Merge (75779cd)Diff
    analytics (logEvent)42.9 kB42.9 kB+21 B (+0.0%)
    database (Append to a list of data)147 kB148 kB+256 B (+0.2%)
    database (Filtering data)146 kB147 kB+256 B (+0.2%)
    database (Listen for child events)162 kB163 kB+256 B (+0.2%)
    database (Listen for value events + Detach listeners)162 kB163 kB+256 B (+0.2%)
    database (Listen for value events)162 kB163 kB+256 B (+0.2%)
    database (Read data once)162 kB162 kB+256 B (+0.2%)
    database (Save data as transactions)164 kB165 kB+256 B (+0.2%)
    database (Sort data)148 kB148 kB+256 B (+0.2%)
    database (Write data)147 kB147 kB+256 B (+0.2%)
    firestore (Persistence)276 kB276 kB+252 B (+0.1%)
    firestore (Query Cursors)213 kB213 kB+259 B (+0.1%)
    firestore (Query)214 kB214 kB+259 B (+0.1%)
    firestore (Read data once)202 kB202 kB+259 B (+0.1%)
    firestore (Realtime updates)204 kB204 kB+259 B (+0.1%)
    firestore (Transaction)186 kB186 kB+259 B (+0.1%)
    firestore (Write data)185 kB186 kB+259 B (+0.1%)
    firestore-lite (Query Cursors)71.0 kB71.3 kB+259 B (+0.4%)
    firestore-lite (Query)74.2 kB74.4 kB+259 B (+0.3%)
    firestore-lite (Read data once)58.6 kB58.8 kB+259 B (+0.4%)
    firestore-lite (Transaction)83.2 kB83.4 kB+259 B (+0.3%)
    firestore-lite (Write data)68.3 kB68.6 kB+259 B (+0.4%)
    functions (call)30.5 kB30.8 kB+258 B (+0.8%)
    storage (getBytes)39.7 kB39.9 kB+263 B (+0.7%)
    storage (getDownloadURL)41.8 kB42.0 kB+263 B (+0.6%)
    storage (getMetadata)41.2 kB41.5 kB+263 B (+0.6%)
    storage (list + listAll)40.6 kB40.9 kB+263 B (+0.6%)
    storage (updateMetadata)41.5 kB41.7 kB+263 B (+0.6%)
    storage (uploadBytes)46.0 kB46.3 kB+263 B (+0.6%)
    storage (uploadBytesResumable)55.9 kB56.2 kB+361 B (+0.6%)
    storage (uploadString)46.2 kB46.5 kB+263 B (+0.6%)

  • firebase

    11 size changes

    TypeBase (29d0340)Merge (75779cd)Diff
    firebase-analytics-compat.js25.8 kB25.8 kB+21 B (+0.1%)
    firebase-analytics.js24.9 kB24.9 kB+21 B (+0.1%)
    firebase-auth-react-native.js149 kB149 kB+296 B (+0.2%)
    firebase-compat.js740 kB740 kB+178 B (+0.0%)
    firebase-database.js154 kB154 kB+245 B (+0.2%)
    firebase-firestore-compat.js314 kB314 kB-1 B (-0.0%)
    firebase-firestore-lite.js88.6 kB88.8 kB+227 B (+0.3%)
    firebase-firestore.js314 kB314 kB+221 B (+0.1%)
    firebase-functions.js10.5 kB10.8 kB+226 B (+2.1%)
    firebase-storage-compat.js38.8 kB39.0 kB+158 B (+0.4%)
    firebase-storage.js38.1 kB38.5 kB+390 B (+1.0%)

Test Logs

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

@google-oss-bot
Copy link
Contributor

google-oss-bot commented Oct 8, 2022

Size Analysis Report 1

Affected Products

  • @firebase/analytics

    • getAnalytics

      Size

      TypeBase (29d0340)Merge (75779cd)Diff
      size9.98 kB10.0 kB+21 B (+0.2%)
      size-with-ext-deps42.8 kB42.8 kB+21 B (+0.0%)
    • initializeAnalytics

      Size

      TypeBase (29d0340)Merge (75779cd)Diff
      size9.88 kB9.90 kB+21 B (+0.2%)
      size-with-ext-deps36.0 kB36.1 kB+21 B (+0.1%)
    • isSupported

      Size

      TypeBase (29d0340)Merge (75779cd)Diff
      size9.77 kB9.79 kB+21 B (+0.2%)
      size-with-ext-deps35.6 kB35.6 kB+21 B (+0.1%)
    • logEvent

      Size

      TypeBase (29d0340)Merge (75779cd)Diff
      size9.63 kB9.65 kB+21 B (+0.2%)
      size-with-ext-deps35.5 kB35.5 kB+21 B (+0.1%)
    • setAnalyticsCollectionEnabled

      Size

      TypeBase (29d0340)Merge (75779cd)Diff
      size9.79 kB9.81 kB+21 B (+0.2%)
      size-with-ext-deps35.6 kB35.7 kB+21 B (+0.1%)
    • setConsent

      Size

      TypeBase (29d0340)Merge (75779cd)Diff
      size9.76 kB9.78 kB+21 B (+0.2%)
      size-with-ext-deps35.6 kB35.6 kB+21 B (+0.1%)
    • setCurrentScreen

      Size

      TypeBase (29d0340)Merge (75779cd)Diff
      size9.87 kB9.89 kB+21 B (+0.2%)
      size-with-ext-deps35.7 kB35.7 kB+21 B (+0.1%)
    • setDefaultEventParameters

      Size

      TypeBase (29d0340)Merge (75779cd)Diff
      size9.74 kB9.77 kB+21 B (+0.2%)
      size-with-ext-deps35.6 kB35.6 kB+21 B (+0.1%)
    • setUserId

      Size

      TypeBase (29d0340)Merge (75779cd)Diff
      size9.86 kB9.88 kB+21 B (+0.2%)
      size-with-ext-deps35.7 kB35.7 kB+21 B (+0.1%)
    • setUserProperties

      Size

      TypeBase (29d0340)Merge (75779cd)Diff
      size9.94 kB9.96 kB+21 B (+0.2%)
      size-with-ext-deps35.8 kB35.8 kB+21 B (+0.1%)
    • settings

      Size

      TypeBase (29d0340)Merge (75779cd)Diff
      size9.75 kB9.77 kB+21 B (+0.2%)
      size-with-ext-deps35.6 kB35.6 kB+21 B (+0.1%)
  • @firebase/database

    • getDatabase

      Size

      TypeBase (29d0340)Merge (75779cd)Diff
      size116 kB116 kB-25 B (-0.0%)
      size-with-ext-deps145 kB145 kB+256 B (+0.2%)

      External Dependency

      ModuleBase (29d0340)Merge (75779cd)Diff
      @firebase/util

      25 dependencies

      Deferred
      Sha1
      assert
      assertionError
      base64
      base64Encode
      contains
      createMockUserToken
      deepCopy
      errorPrefix
      getDefaultEmulatorHost
      getModularInstance
      isAdmin
      isEmpty
      isMobileCordova
      isNodeSdk
      isReactNative
      isValidFormat
      jsonEval
      map
      querystring
      safeGet
      stringLength
      stringToByteArray
      stringify

      25 dependencies

      Deferred
      Sha1
      assert
      assertionError
      base64
      base64Encode
      contains
      createMockUserToken
      deepCopy
      errorPrefix
      getDefaultEmulatorHostnameAndPort
      getModularInstance
      isAdmin
      isEmpty
      isMobileCordova
      isNodeSdk
      isReactNative
      isValidFormat
      jsonEval
      map
      querystring
      safeGet
      stringLength
      stringToByteArray
      stringify

      + getDefaultEmulatorHostnameAndPort
      - getDefaultEmulatorHost

  • @firebase/firestore

    • getFirestore

      Size

      TypeBase (29d0340)Merge (75779cd)Diff
      size18.5 kB18.4 kB-29 B (-0.2%)
      size-with-ext-deps85.0 kB85.3 kB+254 B (+0.3%)

      External Dependency

      ModuleBase (29d0340)Merge (75779cd)Diff
      @firebase/util

      FirebaseError
      createMockUserToken
      getDefaultEmulatorHost

      FirebaseError
      createMockUserToken
      getDefaultEmulatorHostnameAndPort

      + getDefaultEmulatorHostnameAndPort
      - getDefaultEmulatorHost

  • @firebase/functions

    • getFunctions

      Size

      TypeBase (29d0340)Merge (75779cd)Diff
      size2.63 kB2.60 kB-25 B (-1.0%)
      size-with-ext-deps26.7 kB27.0 kB+258 B (+1.0%)

      External Dependency

      ModuleBase (29d0340)Merge (75779cd)Diff
      @firebase/util

      getDefaultEmulatorHost
      getModularInstance

      getDefaultEmulatorHostnameAndPort
      getModularInstance

      + getDefaultEmulatorHostnameAndPort
      - getDefaultEmulatorHost

  • @firebase/storage

    • _UploadTask

      Size

      TypeBase (29d0340)Merge (75779cd)Diff
      size29.5 kB29.6 kB+98 B (+0.3%)
      size-with-ext-deps46.5 kB46.6 kB+98 B (+0.2%)
    • getStorage

      Size

      TypeBase (29d0340)Merge (75779cd)Diff
      size10.5 kB10.5 kB-25 B (-0.2%)
      size-with-ext-deps35.3 kB35.5 kB+263 B (+0.7%)

      External Dependency

      ModuleBase (29d0340)Merge (75779cd)Diff
      @firebase/util

      FirebaseError
      createMockUserToken
      getDefaultEmulatorHost
      getModularInstance

      FirebaseError
      createMockUserToken
      getDefaultEmulatorHostnameAndPort
      getModularInstance

      + getDefaultEmulatorHostnameAndPort
      - getDefaultEmulatorHost

    • uploadBytesResumable

      Size

      TypeBase (29d0340)Merge (75779cd)Diff
      size29.7 kB29.8 kB+98 B (+0.3%)
      size-with-ext-deps46.7 kB46.8 kB+98 B (+0.2%)
  • @firebase/util

    • getDefaultEmulatorHostnameAndPort

      Size

      TypeBase (29d0340)Merge (75779cd)Diff
      size?4.14 kB? (?)
      size-with-ext-deps?4.14 kB? (?)

      Dependency

      TypeBase (29d0340)Merge (75779cd)Diff
      functions?

      getGlobal

      ?
      classes??
      variables?

      base64
      base64Decode
      byteArrayToString
      getDefaultEmulatorHost
      getDefaultEmulatorHostnameAndPort
      getDefaults
      getDefaultsFromCookie
      getDefaultsFromEnvVariable
      getDefaultsFromGlobal
      stringToByteArray$1

      ?
      enums??

Test Logs

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

packages/storage/src/task.ts Outdated Show resolved Hide resolved
@maneesht maneesht merged commit 5f55ed8 into master Oct 12, 2022
@maneesht maneesht deleted the mtewani/fix-exponential-backoff-pause-resume branch October 12, 2022 17:05
@google-oss-bot google-oss-bot mentioned this pull request Oct 12, 2022
@firebase firebase locked and limited conversation to collaborators Nov 12, 2022
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.

5 participants