fix(compare): retry replacement suggestions after transient fetch failures#2469
fix(compare): retry replacement suggestions after transient fetch failures#2469trivikr wants to merge 1 commit intonpmx-dev:mainfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
2 Skipped Deployments
|
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughModified the Suggested reviewers
🚥 Pre-merge checks | ✅ 1✅ Passed checks (1 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
🔗 Linked issue
N/A
🧭 Context
The compare page caches replacement lookups per package in
useCompareReplacements. That cache treated transient fetch failures the same as a real “no replacement” response by storingnullfor both cases. Once that happened, the package was considered already checked and would never be fetched again for the rest of the session.In practice, a temporary API failure, offline blip, or server 500 could permanently suppress replacement suggestions until the app was reloaded.
📚 Description
This PR changes compare-page replacement caching so only successful fetch results are persisted.
Successful
nullresponses are still cached, which preserves the existing optimization for packages that truly have no replacement suggestion. Thrown fetch errors are no longer written into the cache, which allows the package to be retried on a later watch cycle instead of being suppressed for the rest of the session.