fix: preserve Amazon authentication cookies#72
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #72 +/- ##
==========================================
+ Coverage 61.81% 62.10% +0.28%
==========================================
Files 46 46
Lines 6021 6040 +19
==========================================
+ Hits 3722 3751 +29
+ Misses 2046 2035 -11
- Partials 253 254 +1
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
eshaffer321
marked this pull request as ready for review
July 17, 2026 13:06
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
Root cause
The setup validator created an empty temporary file, then passed that existing file to
amazon-go, whose cookie store tried to parse it as JSON. Separately, the provider usedamazon-go's default auto-save behavior during health checks, so Amazon's sign-in response could replace saved session cookies before the health check returned an authentication error.Impact
Users can complete
itemize amazon setup -account <name>normally, and an authentication failure is now read-only. Successful Amazon operations still persist refreshed cookies.Validation
go test ./...go test ./... -racego build -o <temp>/itemize ./cmd/itemize/golangci-lint,go vet, and full testsamazon -dry-run -days 14 -max 1fetched one order successfully and made no Monarch writesThe branch was fetched and rebased onto
origin/mainimmediately before push.