Skip to content

fix: handle omitted list claims and shipments options - #303

Merged
Justin Hammond (Justintime50) merged 6 commits into
EasyPost:masterfrom
pcbeingused33:fix/c5516-list-claims-nil
Nov 25, 2026
Merged

Justin Hammond (Justintime50) merged 6 commits into
EasyPost:masterfrom
pcbeingused33:fix/c5516-list-claims-nil

Conversation

@pcbeingused33

@pcbeingused33 Alex Castillo González (pcbeingused33) commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

Description

ListClaims(nil) and ListShipments(nil) panic after decoding a successful response because the client dereferences the omitted options when saving query parameters for pagination. UpdateWebhook(id, nil) panics the same way before sending the request.

Copy the list options only when they were supplied, matching the guard ListTrackersWithContext already has (#301). Unfiltered calls return the decoded results with zero-value parameters, and filtered calls still save their parameters for the next page. UpdateWebhook now sends an empty update when no options are given, which re-enables the webhook as its doc comment describes. No other function in the library dereferences optional list options; ListTrackers was already guarded, and the remaining list calls pass options straight through to the request.

Also preps v6.0.1 (CHANGELOG.md and version.go).

Testing

Calling ListClaims(nil), ListShipments(nil) and UpdateWebhook(id, nil) against a mocked HTTP 200 panicked on master and returns the decoded results with the guard. The full test suite passes.

Pull Request Type

  • Bug fix (non-breaking change which fixes an issue)

This change was prepared with assistance from an AI tool.

@Justintime50 Justin Hammond (Justintime50) changed the title fix: handle omitted list claims options fix: handle omitted list claims and shipments options Nov 25, 2026
@Justintime50
Justin Hammond (Justintime50) merged commit aa5d80e into EasyPost:master Nov 25, 2026
10 checks passed
@Justintime50

Copy link
Copy Markdown
Member

Thanks for the PR and find! There were 2 other related spots that I made changes for. I removed the test because our test suites for libs only do e2e API calls - your test verified the change is valid. This is released in v6.0.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants