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

Fix storage-types #3945

Merged
merged 5 commits into from
Oct 20, 2020
Merged

Fix storage-types #3945

merged 5 commits into from
Oct 20, 2020

Conversation

hsubox76
Copy link
Contributor

Separated out from storage modularization PR: #3499

Should fix #1515

@changeset-bot
Copy link

changeset-bot bot commented Oct 14, 2020

⚠️ No Changeset found

Latest commit: fb010a6

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

@google-oss-bot
Copy link
Contributor

google-oss-bot commented Oct 14, 2020

Binary Size Report

Affected SDKs

  • @firebase/storage

    Type Base (0204abf) Head (9dd1d28) Diff
    esm2017 55.0 kB 54.9 kB -52 B (-0.1%)
    main 61.4 kB 61.1 kB -304 B (-0.5%)
    module 61.1 kB 60.8 kB -298 B (-0.5%)
  • @firebase/util

    Type Base (0204abf) Head (9dd1d28) Diff
    browser 21.0 kB 21.2 kB +279 B (+1.3%)
    esm2017 18.6 kB 18.9 kB +269 B (+1.4%)
    main 21.0 kB 21.3 kB +279 B (+1.3%)
    module 19.9 kB 20.1 kB +263 B (+1.3%)
  • firebase

    Type Base (0204abf) Head (9dd1d28) Diff
    firebase-storage.js 39.6 kB 39.2 kB -329 B (-0.8%)
    firebase.js 831 kB 830 kB -334 B (-0.0%)

Test Logs

@google-oss-bot
Copy link
Contributor

google-oss-bot commented Oct 14, 2020

Size Analysis Report

Affected Products

No changes between base commit (0204abf) and head commit (9dd1d28).

Test Logs

Copy link
Contributor

@schmidt-sebastian schmidt-sebastian left a comment

Choose a reason for hiding this comment

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

Thanks for doing this!

We also need to update packages/firebase/index.d.ts

| null
| ((a: UploadTaskSnapshot) => any),
error?: ((a: Error) => any) | null,
| ((a: UploadTaskSnapshot) => unknown),
Copy link
Contributor

Choose a reason for hiding this comment

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

This unknown seems inconsistent with the other return types.

Since this is going to land in a breaking change release, do you think it makes sense to start using more descriptive names than "a"? (here and everywhere)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure, seems like a good idea.

name: string;
code: string;
message: string;
serverResponse: null | string;
Copy link
Member

Choose a reason for hiding this comment

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

Who adds serverResponse to the error object?
In #3946, I'm moving template data under a new field customData to avoid overwriting existing fields, should we do the same for serverResponse?

@hsubox76
Copy link
Contributor Author

Depends on #3946, rebase after that is merged.

* An error returned by the Firebase Storage SDK.
*/
interface FirebaseStorageError extends FirebaseError {
customData: { serverResponse: string | null };
Copy link
Member

Choose a reason for hiding this comment

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

Since you have a getter serverResponse, customData feels like the internal implementation and you can just expose the getter.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

@hsubox76 hsubox76 merged commit 2b06694 into master Oct 20, 2020
@firebase firebase locked and limited conversation to collaborators Nov 20, 2020
@hsubox76 hsubox76 deleted the ch-storage-types branch January 21, 2021 20:30
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.

Wrong type information for firebase.storage.UploadTask.on(.., .., error, ..)
4 participants