Commit 21b0ab1
Implement HueStack sync pattern for transaction tracking
Architecture Changes (Following HueStack Pattern):
- Content script: Save to chrome.storage.local only, no API calls
- Background script: Handles all API syncing automatically
- Periodic sync: Every 60 seconds via chrome.alarms
- Direct fetch from background (bypasses CORS with host_permissions)
- Exponential backoff retry: 3 attempts with 1s, 2s, 4s delays
- Never lose data: Transactions saved locally first, synced later
Key Improvements:
✅ No CORS issues (background script has unrestricted fetch)
✅ Offline-first (works without network connection)
✅ Automatic retry (up to 5 attempts over time)
✅ Simple notifications (just "saved" or "error")
✅ Zero user intervention needed
✅ Background syncing doesn't block user
Files Changed:
- background.js: Added automatic sync system with retry logic
- transactionMonitor.js: Simplified to local-save-only pattern
Pattern learned from: D:\AppADay\huestack\huestack-extension
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>1 parent c628f8c commit 21b0ab1
2 files changed
Lines changed: 942 additions & 20 deletions
0 commit comments