-
Notifications
You must be signed in to change notification settings - Fork 894
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
FirebaseServerAppImpl: guard use of FinalizationRegistry based on its availability. #8335
Conversation
🦋 Changeset detectedLatest commit: 17bff19 The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 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 |
Do we want to throw if releaseOnDeref is used an finalization registery is not available? |
Size Report 1Affected Products
Test Logs |
Size Analysis Report 1Affected Products
Test Logs |
We already do in initializeServerApp. |
… availability. (#8335) There was code that would errantly attempt to allocate a FinalizationRegstiry in FirebaseServerAppImpl regardless of the existence of releaseOnDeref field, and this caused issues in some edge environments. This change fixes that issue.
Discussion
The code had already guarded use of the
FinalizationRegstiry
during the initialization ofFirebaseServerApp
ininitializeServerApp
if thereleaseOnDeref
configuration parameter was defined. This gating was to provide functionality in older node versions. However, there was other code that would errantly attempt to allocate aFinalizationRegstiry
inFirebaseServerAppImpl
regardless of the existence ofreleaseOnDeref
field, and this caused issues in some edge environments.This change fixes that issue.
Testing
I had tested this previously using Node v14.14.0, which is the release version previous to the reported addition of the FinalizationRegistry, and our code had worked. However, it appears that 14.14.0 actually includes the FinalizationRegistry, so my tests completed successfully when they shouldn't have.
I was able to reproduce this problem in Node 14.0.0, and that's the version I used to test this fix.
API Changes
N/A.