Skip to content

Delete app from Database when deleted in Core. #194

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

Merged
merged 3 commits into from
Aug 17, 2017

Conversation

ryanwilson
Copy link
Member

When a FIRApp is deleted in Core, it should also be deleted from
the instances array in Database.

See #160 for more details.

When a FIRApp is deleted in Core, it should also be deleted from
the instances array in Database.

See #160 for more details.
@ryanwilson
Copy link
Member Author

@dylancopeland I'll look into it!

@ryanwilson
Copy link
Member Author

@mikelehen - is calling goOffline on the instance enough to clear everything out, or what should I be doing in order to ensure everything's cleaned up well?

@ryanwilson ryanwilson requested a review from mikelehen August 15, 2017 02:20
@mikelehen
Copy link
Contributor

I think the best cleanup you can do is:

[FRepoManager disposeRepos:self.config];

But this mostly exists for testing purposes and isn't guaranteed to clean everything up (there will likely be memory leaks) and it doesn't really transition our objects into a permanent zombie state. Some operations against existing FIRDatabaseReference instances may still work, or appear to work, and if you were to manually call goOnline it may bring the instance back to life.

So it's better than nothing, but if we care about delete working properly, we'll need to invest in more code to do proper cleanup / zombification of our objects.

@ryanwilson
Copy link
Member Author

Added the cleanup call, thanks @mikelehen.

@ryanwilson ryanwilson merged commit 566665e into master Aug 17, 2017
@ryanwilson ryanwilson deleted the rw-database-delete-app branch August 17, 2017 15:15
minafarid pushed a commit to minafarid/firebase-ios-sdk that referenced this pull request Jun 6, 2018
* Delete an app from Database when deleted in Core.

When a FIRApp is deleted in Core, it should also be deleted from
the instances array in Database.

See firebase#160 for more details.

* Add tests for deleting databases.

* Add call to clean up deleted FIRDatabase instance.
@firebase firebase locked and limited conversation to collaborators Nov 13, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants