Skip to content

revert: "fix(settings): preserve settings on deactivation" (#1750) - #1771

Closed
NabDevs wants to merge 2 commits into
mainfrom
revert/pr-1750-preserve-settings-on-deactivation
Closed

revert: "fix(settings): preserve settings on deactivation" (#1750)#1771
NabDevs wants to merge 2 commits into
mainfrom
revert/pr-1750-preserve-settings-on-deactivation

Conversation

@NabDevs

@NabDevs NabDevs commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Reverts #1750 (squash commit 4bbd2ed).

The change was merged prematurely — it still needs to be tested. This temporary revert keeps main releasable so the next release does not ship the untested change.

Re-landing after testing: restore the original branch (feat/restore-carrier-settings-reactivation) and either revert this revert or re-apply the commits on a fresh branch (the original commits remain in main's history, so a plain re-merge will report "nothing to merge").

NabDevs and others added 2 commits August 7, 2026 10:04
* Restore carrier settings

* fix: narrow settings restore

* fix: preserve settings on deactivation
Reverts squash commit 4bbd2ed. The change was merged prematurely and still
needs to be tested. Temporary revert to keep main releasable.

Re-land after testing by reverting this revert or re-applying the branch.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Copilot AI lite review requested due to automatic review settings August 7, 2026 08:13
@NabDevs
NabDevs requested a review from a team as a code owner August 7, 2026 08:13
@codecov

codecov Bot commented Aug 7, 2026

Copy link
Copy Markdown

❌ 1 Tests Failed:

Tests completed Failed Passed Skipped
216 1 215 0
View the full list of 1 ❄️ flaky test(s)
src/components/pdk/components.spec.ts::src/components/pdk/components.spec.ts

Flake rate in main: 100.00% (Passed 0 times, Failed 154 times)

Stack Traces | 0s run time
Error: [🍍]: "getActivePinia()" was called but there was no active Pinia. Are you trying to use a store before calling "app.use(pinia)"?
See https://pinia.vuejs.org/core-concepts/outside-component-usage.html for help.
This will fail in production.
 ❯ Module.useStore ../../../node_modules/@.../pinia/dist/pinia.mjs:1741:19
 ❯ runModalTest ../../../node_modules/@.../src/components/runModalTest.ts:7:44
 ❯ ../../../node_modules/@.../src/tests/executeAdminComponentTest.ts:29:7

To view more test analytics, go to the Test Analytics Dashboard
📋 Got 3 mins? Take this short survey to help us improve Test Analytics.

@myparcel-bot

myparcel-bot Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

✅ Build successful!

You can find a link to the downloadable artifact below.

Name Link
Commit 2031079
Logs https://github.com/myparcelnl/woocommerce/actions/runs/31160814477
Download https://github.com/myparcelnl/woocommerce/suites/84554997048/artifacts/8987037215

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR reverts the previously merged “preserve settings on deactivation” change (#1750) to restore the prior deactivation/uninstall behavior and remove the one-off “restore v6 options” repair migration that was merged before it was fully tested.

Changes:

  • Reintroduces running the PDK uninstall flow on WordPress plugin deactivation (via register_deactivation_hook()).
  • Removes the one-time v6 options restore migration and its unit test coverage.
  • Simplifies/removes several WordPress test mocks that were only needed for the removed migration, and updates snapshots accordingly.

Reviewed changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
woocommerce-myparcel.php Re-adds a deactivation hook and an uninstall() callback that calls Installer::uninstall().
src/Service/WpInstallerService.php Restores an override to avoid updating the installed version when the provided version is null.
config/pdk.php Removes the migrationDirectory config that was used for timestamped migration discovery.
src/Migration/2026_08_04_101714_restore_v6_options.php Deletes the one-off repair migration introduced in #1750.
tests/Unit/Migration/RestoreV6OptionsTest.php Deletes unit tests for the removed repair migration.
tests/Unit/EntryTest.php Updates the deactivation-related expectation (but currently in a way that doesn’t actually assert the hook exists).
tests/Mock/WordPressOptions.php Simplifies mocked get_option() behavior.
tests/Mock/MockWpdb.php Removes option-query helpers that were only used by the deleted repair migration tests.
tests/mock_wp_functions.php Removes the delete_option() mock (previously used by the deleted repair migration).
tests/snapshots/*.json Updates snapshots to include the deactivation hook registration.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread tests/Unit/EntryTest.php
Comment on lines +52 to 56
it('runs uninstall on deactivate', function () {
MockWpActions::execute('deactivate_woocommerce-myparcel');

expect(MockWpActions::toArray())->not->toHaveKey('deactivate_woocommerce-myparcel')
->and(WordPressOptions::getOption('_myparcelcom_carrier'))
->toBe(['POSTNL' => ['enabled' => true]]);
expect(MockWpActions::get('deactivate_woocommerce-myparcel'))->toBe([]);
});
@NabDevs

NabDevs commented Aug 7, 2026

Copy link
Copy Markdown
Contributor Author

Overbodig: main is één commit teruggezet (history rewrite i.p.v. revert) — #1750 komt na het testen via een nieuwe PR terug.

@NabDevs NabDevs closed this Aug 7, 2026
@NabDevs
NabDevs deleted the revert/pr-1750-preserve-settings-on-deactivation branch August 7, 2026 08:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants