-
Notifications
You must be signed in to change notification settings - Fork 927
Fix infinite recursion in FirebaseStorageError message getter #4760
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
Conversation
🦋 Changeset detectedLatest commit: 253dc67 The changes in this PR will be included in the next version bump. This PR includes changesets to release 7 packages
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 |
@@ -27,16 +27,15 @@ export class FirebaseStorageError extends FirebaseError { | |||
*/ | |||
customData: { serverResponse: string | null } = { serverResponse: null }; | |||
|
|||
private readonly baseMessage: string; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
_baseMessage
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
'@firebase/storage': patch | ||
--- | ||
|
||
Fix infinite recursion in FirebaseStorageError message getter |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there an associated Github issue? Or an example of when the problem comes up in usage? So I can better explain to users in the release notes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No there isn't an existing issue (beyond this PR). Basically any time the message
getter is accessed you would get a Maximum call stack size exceeded
Error raised.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, I thought the test failures were flaky and missed the actual problem. super()
needs to be called with the message or else when the error is thrown it doesn't actually throw with the message. I don't think the property can be overridden with a getter. I think we should keep _baseMessage
, get rid of get message()
, and add some code to set serverResponse
to either set this.message
to _baseMessage + serverResponse
or _baseMessage
depending on the arg.
Superseded by #4807 |
This was originally broken in the refactor in #3945