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

Handle the closing of dependent databases from the abstract adapter #8575

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

maximerety
Copy link

Context

This PR shows how we could align the code responsible to handle the closing of dependent databases with the existing code for database destroy.

All details available in: Inconsistent handling of dependent databases during close and destroy - #8574

Fixes #8574

Additional comments

Skipped tests

I had to skip 2 more tests in tests/integration/test.close.js because they were incompatible with the changes in this PR.

Note that this test file, introduced more than 5 years ago in 96a5dfc, contains a majority of tests labeled FIXME... which have never been fixed since. I don't know the original author's intention, but it could be that they wanted to support future behaviors (like "destroy after close" on a database) but they were never implemented. I wonder if this test file should be discarded as it doesn't add much value... only confusion for PRs like this. Indeed, the tests I had to skip previously worked "accidentally" and not because of proper design to support them.

As said in issue #8574, I am not an expert of PouchDB so other opinions are very welcome.

Test for original issue #7331

The investigations leading to this proposal started after a patch was merged to fix #7331 (more about that in #8574).

Note that no tests were required to merge this patch at the time.

I considered adding a test for this use case to avoid regressions, but I have to admit that I don't understand exactly what was needed at the time... and even if the scenario should be supported (deleting files from disk can "desynchronize" the contents of '_local/_pouch_dependentDbs'). Feel free to give me more context if something is missing in this regard.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant