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

Fix cache / DB sync issue with primary domains #94

Merged
merged 9 commits into from
May 2, 2022

Conversation

cameronterry
Copy link
Owner

This resolves the issue found in the new unit tests by rearranging the logic for primary domains to ensure both the database and cache stay in sync.

Namely, the cache handling is mostly moved to DarkMatter_Domains instead of DarkMatter_Primary by ensuring the "updates" for domains are managed in a single place. This also removes some duplicate database logic that was missed in previous iterations of the plugin since version 2.0.0.

Resolves the two unit test errors:

5) PrimaryDomainTest::test_set_primary_domain
Cached update to primary.
Failed asserting that false is true.

/home/runner/work/dark-matter/dark-matter/tests/phpunit/domain-mapping/PrimaryDomainTest.php:124

6) PrimaryDomainTest::test_unset_primary_domain
Cached update to unset primary.
Failed asserting that true is false.

/home/runner/work/dark-matter/dark-matter/tests/phpunit/domain-mapping/PrimaryDomainTest.php:160

Fixes: #93

@cameronterry cameronterry self-assigned this May 1, 2022
@cameronterry cameronterry merged commit 0966075 into release/2.3.0 May 2, 2022
@cameronterry cameronterry deleted the fix/primary-domain-update-cache branch May 2, 2022 07:50
@cameronterry cameronterry mentioned this pull request May 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant