purolator: make tracking status description-aware for Undeliverable/Other scans#971
Open
HansDaigle wants to merge 5564 commits intokarrioapi:mainfrom
Open
purolator: make tracking status description-aware for Undeliverable/Other scans#971HansDaigle wants to merge 5564 commits intokarrioapi:mainfrom
HansDaigle wants to merge 5564 commits intokarrioapi:mainfrom
Conversation
…nner while loading
Fix Cache.get() writing None to system cache instead of actual value when syncing from shallow cache. Reduce DHL Parcel DE buffer_minutes from 30 to 5 to prevent tokens from being considered immediately expired when expires_in <= 1800s.
- Fix periodic_data_archiving running every minute by setting crontab to daily at midnight - Always include feature flags in CONSTANCE_CONFIG with False default when module absent - Replace naive datetime.now() with timezone.now() for Fee record queries - Fix health status API double-slash URL causing 404 - Add keyword search field to tracing records filter
fix: resolve OSS admin bugs and developer tools issues
|
@HansDaigle is attempting to deploy a commit to the karrio Team on Vercel. A member of the Team first needs to authorize it. |
Contributor
Author
|
Implementation note: Purolator can emit the same |
Contributor
Author
|
Follow-up: added French-description handling as well (accent-insensitive normalization + FR fallback keywords for Undeliverable), since Purolator settings support language=fr. Added dedicated test coverage in modules/connectors/purolator/tests/purolator/test_tracking.py. |
Member
|
Merged into patch-2026.1.16 release branch. |
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.
Summary
Purolator tracking status mapping is currently derived only from
ScanType(for example, allUndeliverablescans are mapped to one status). In production payloads, the sameScanTypecan represent materially different outcomes based on the description (pickup-ready, return-to-sender, delayed, etc.).This PR makes Purolator tracking status mapping description-aware while keeping a safe default for unknown descriptions.
Why this needs an update
ScanTypealone is too coarse for Purolator tracking semantics.ScanTypeappears with different descriptions that should map to different normalized statuses.ready_for_pickupvsreturn_to_sendervsdelivery_delayed).language=fr; status mapping must therefore tolerate French descriptions too.Real-life validation dataset
This mapping was derived and validated against real historical Purolator tracking data from production logs:
Changes
modules/connectors/purolator/karrio/providers/purolator/units.pymap_tracking_status(event_code, event_description)Other,OnDelivery,Delivery,ProofOfPickUp,UndeliverableUndeliverablewording variantslanguage=frresponsesTrackingStatusenum values used by this mappermodules/connectors/purolator/karrio/providers/purolator/tracking.pymodules/connectors/purolator/tests/purolator/test_tracking.pyTests
Executed:
Result: 25 passed