Repository navigation
feat: delete removed sites' records in the background - #366
Merged
Merged
Conversation
justlevine
requested review from
Utsav-Ladani and
up1512001
and
a balanced review from Copilot
October 26, 2026 20:54
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## feat/action-scheduler-jobs #366 +/- ##
================================================================
- Coverage 88.83% 88.81% -0.02%
- Complexity 838 847 +9
================================================================
Files 48 49 +1
Lines 3270 3291 +21
Branches 181 182 +1
================================================================
+ Hits 2905 2923 +18
- Misses 308 311 +3
Partials 57 57
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Status polling and the setup gate can prevent administrators from discovering or retrying failed deletions.
2 open issues
What changed in this PR
Moves removed brand sites’ Algolia record deletion into background jobs, with failure reporting and retries through the governing site’s search settings.
Changes:
- Adds a deletion job and retries failed deletions during re-indexing.
- Clears deletion records when sites are re-added or the governing site becomes a consumer.
- Adds failure messaging and integration coverage, and removes the extended deregistration timeout.
| File | Description |
|---|---|
| tests/phpunit/Integration/Modules/Search/SettingsTest.php | Covers background deletion and job cleanup. |
| tests/phpunit/Integration/Modules/Search/Jobs/Delete_Site_Records_JobTest.php | Tests deletion failures, reporting, and retries. |
| tests/phpunit/Integration/Modules/Rest/Remote_ClientTest.php | Removes the extended-timeout assertion. |
| tests/phpunit/Integration/Modules/Rest/Indexer_Controller_GoverningSiteTest.php | Tests retrying failed deletions during re-indexing. |
| tests/phpunit/Integration/Modules/Rest/Brand_Site_Controller_GoverningSiteTest.php | Verifies background cleanup after deregistration. |
| tests/js/IndexStatus.test.tsx | Tests deletion failure messaging and hidden progress. |
| inc/Modules/Search/Settings.php | Queues deletions and clears obsolete job records. |
| inc/Modules/Search/Jobs/Jobs.php | Registers the deletion job. |
| inc/Modules/Search/Jobs/Delete_Site_Records_Job.php | Implements background deletion, failure reporting, and retries. |
| inc/Modules/Rest/Remote_Client.php | Removes the extended deregistration timeout. |
| inc/Modules/Rest/Indexer_Controller.php | Retries failed deletions during governing-site re-indexing. |
| assets/src/components/JobStatus.tsx | Displays deletion failure and recovery guidance. |
Review effort: Balanced
justlevine
force-pushed
the
feat/background-purge
branch
from
October 28, 2026 13:56
28ae6ea to
462c8db
Compare
justlevine
force-pushed
the
feat/background-purge
branch
from
October 28, 2026 13:57
462c8db to
20041ba
Compare
7 tasks done
up1512001
approved these changes
Oct 29, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

What
Removing a brand site now deletes its Algolia records in a background job. If the delete fails, it shows on the settings screen.
Why
On
main, removing a brand site deleted its records inside the request. If Algolia failed, the error only went to the log, and the removed site's content stayed in search.Related Issue(s):
How
Delete_Site_Records_Jobdeletes one removed site's records. A failed delete shows on the governing site's row, since the removed site is no longer listed.AI Disclosure
Opus 5.5. wrote the tests and drafted the PR description
Testing Instructions
Screenshots
Additional Info
Checklist