Skip to content

fix: preserve Amazon browser sessions - #81

Merged
eshaffer321 merged 3 commits into
mainfrom
codex/amazon-session-persistence
Jul 26, 2026
Merged

fix: preserve Amazon browser sessions#81
eshaffer321 merged 3 commits into
mainfrom
codex/amazon-session-persistence

Conversation

@eshaffer321

Copy link
Copy Markdown
Owner

Summary

  • upgrade to amazon-go v0.4.0 and persist the authenticated browser fingerprint with cookies
  • validate imports with the same fingerprint, atomically replace stale snapshots, and retain refreshed cookies
  • replay the fingerprint for order, health-check, and Return Center requests, with a legacy profile fallback

Root cause

The guided browser authenticated with Chromium 143, while later amazon-go v0.3.0 requests advertised Chrome 120 and omitted User-Agent Client Hints. Amazon intermittently rejected that mismatched identity even though the core cookies remained valid. Old browser snapshots also retained deleted or expired cookies.

Verification

  • go test ./...
  • go test ./... -race
  • go vet ./...
  • golangci-lint run --timeout=5m
  • real dry-run against account wife: Processed=1 Skipped=0 Errors=0 without rerunning setup or writing to Monarch
  • amazon-go v0.4.0 release workflow and public Go module resolution verified

Comment thread internal/adapters/providers/amazon/provider.go Fixed
Comment thread internal/cli/amazon_auth.go Fixed
@codecov

codecov Bot commented Jul 26, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 81.48148% with 15 lines in your changes missing coverage. Please review.
✅ Project coverage is 64.70%. Comparing base (989b9db) to head (2d1fb3a).

Files with missing lines Patch % Lines
internal/adapters/providers/amazon/provider.go 79.24% 6 Missing and 5 partials ⚠️
internal/adapters/providers/amazon/returns.go 85.71% 4 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main      #81      +/-   ##
==========================================
+ Coverage   64.53%   64.70%   +0.16%     
==========================================
  Files          49       49              
  Lines        6644     6715      +71     
==========================================
+ Hits         4288     4345      +57     
- Misses       2041     2050       +9     
- Partials      315      320       +5     
Flag Coverage Δ
unittests 64.70% <81.48%> (+0.16%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
internal/adapters/providers/amazon/returns.go 80.34% <85.71%> (+0.62%) ⬆️
internal/adapters/providers/amazon/provider.go 83.70% <79.24%> (-1.70%) ⬇️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@eshaffer321
eshaffer321 merged commit e3bdeaf into main Jul 26, 2026
14 checks passed
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