No way to delete/unmap an App
See original GitHub issueHi. Since there is no way to create an issue in the Firebase Admin SDK private repository, I decided that this was the best place to do it (if I am wrong, please, let me know).
The following exception is thrown whenever initializing an app with the same name twice.
java.lang.IllegalStateException: FirebaseApp name {appName} already exists!
I understand one should not initialize the same app twice. But there should be a way to update the app settings/options/credentials/etc.
The class com.google.firebase.FirebaseApp statically maps apps to their names, and there is no way to unmap an app. Internally, the class has a delete method, which probably does what is needed in order to initialize another app using new com.google.firebase.FirebaseOptions using a previous name, but the method is not visible. Extending com.google.firebase.FirebaseApp is not an option either, hence its constructor is private.
The only way to re-create an app is killing the JVM and starting the process again, which frees the static instances from memory. But that implies killing our backend servers aswell.
Please, consider making delete method public if that would solve this issue.
Thanks.
Issue Analytics
- State:
- Created 7 years ago
- Comments:10 (4 by maintainers)
Top GitHub Comments
This was fixed a long time ago by @hiranya911: https://github.com/firebase/firebase-admin-java/pull/5
If you’re still having issues, file them on the
firebase-admin-java
repository. Thanks for the reminder @djejaquinoWhat’s the status on this? Really need this to happen.