fix(checkout): guard invalid carrier settings - #513
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR hardens the checkout delivery options flow against missing/invalid carrier settings so the checkout doesn’t crash and instead falls back to the default package type while exposing no carriers.
Changes:
- Added a guard in
DeliveryOptionsService::getValidCarrierOptions()to early-return when carrier settings are missing/invalid. - Added a regression test matrix for missing/invalid carrier settings.
- Updated an existing delivery options config unit test to explicitly store enabled carrier settings for PostNL.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
src/App/DeliveryOptions/Service/DeliveryOptionsService.php |
Adds an early-return fallback when carrier settings are empty/invalid to prevent checkout crashes. |
tests/Unit/App/DeliveryOptions/Service/DeliveryOptionsServiceInvalidCarrierSettingsTest.php |
Introduces regression coverage for invalid carrier settings inputs. |
tests/Unit/App/Context/Model/DeliveryOptionsConfigTest.php |
Ensures carrier settings exist/enabled so config expectations remain valid with the new guard behavior. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #513 +/- ##
============================================
+ Coverage 94.32% 94.34% +0.02%
- Complexity 2409 2443 +34
============================================
Files 352 352
Lines 7716 7782 +66
============================================
+ Hits 7278 7342 +64
- Misses 438 440 +2 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
FreekVR
requested changes
Aug 5, 2026
joerivanveen
approved these changes
Aug 6, 2026
FreekVR
approved these changes
Aug 6, 2026
myparcel-bot Bot
pushed a commit
that referenced
this pull request
Aug 7, 2026
* Guard carrier settings * test: clean carrier guard * fix: validate carrier entries * fix: ignore malformed carrier settings * refactor: simplify carrier settings guard
myparcel-bot Bot
pushed a commit
that referenced
this pull request
Aug 7, 2026
* Guard carrier settings * test: clean carrier guard * fix: validate carrier entries * fix: ignore malformed carrier settings * refactor: simplify carrier settings guard
myparcel-bot Bot
pushed a commit
that referenced
this pull request
Aug 7, 2026
* Guard carrier settings * test: clean carrier guard * fix: validate carrier entries * fix: ignore malformed carrier settings * refactor: simplify carrier settings guard
myparcel-bot Bot
pushed a commit
that referenced
this pull request
Aug 7, 2026
* Guard carrier settings * test: clean carrier guard * fix: validate carrier entries * fix: ignore malformed carrier settings * refactor: simplify carrier settings guard
myparcel-bot Bot
pushed a commit
that referenced
this pull request
Aug 7, 2026
* Guard carrier settings * test: clean carrier guard * fix: validate carrier entries * fix: ignore malformed carrier settings * refactor: simplify carrier settings guard
myparcel-bot Bot
pushed a commit
that referenced
this pull request
Aug 7, 2026
* Guard carrier settings * test: clean carrier guard * fix: validate carrier entries * fix: ignore malformed carrier settings * refactor: simplify carrier settings guard
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.
Prevents the checkout from crashing when carrier settings are missing or invalid. In that case, the delivery options service uses the default package type and returns no carriers. Includes regression coverage for missing and malformed settings.
Relates to: Woo PR
fixes INT-1730