Repository navigation
useBountyStatus: a transient fetch failure mid-session silently swaps the live bounty for static fallbackBounty and fires a false onStatusChange #571
Description
Activity
- addedbugSomething isn't workingSomething isn't workinghelp wantedExtra attention is neededExtra attention is neededvery hardVery difficult task, expert-level effort requiredVery difficult task, expert-level effort requiredStellar WaveIssues in the Stellar wave programIssues in the Stellar wave program
on Sep 27, 2026 @chonilius This issue could not be added to the Stellar Wave Program because the per-repo points budget would be exceeded (25000 / 25000 points already used). The label has been automatically removed.
The budget resets at the end of each Wave. You can review the remaining budget for your repos on the Orgs & Repos page.
- removedStellar WaveIssues in the Stellar wave programIssues in the Stellar wave program
on Sep 27, 2026 Greetings @maintainers,
I would like to take on and implement this issue:
useBountyStatus: a transient fetch failure mid-session silently swaps the live bounty for static fallbackBounty and fires a false onStatusChange.Technical Implementation Roadmap:
- Deep Codebase Audit: Inspect current architecture and data flows in
MergeFi/frontendto design an optimal, idiomatic solution. - Core Modular Implementation: Implement
useBountyStatus: a transient fetch failure mid-session silently swaps the live bounty for static fallbackBounty and fires a false onStatusChangewith clean separation of concerns and robust error handling. - Comprehensive Automated Test Matrix: Add end-to-end integration and unit tests covering positive execution and edge failure modes.
- Production CI Verification: Ensure all linters, formatting checks, and GitHub Actions workflows pass with 100% green status.
I have worked extensively on similar architectures and can deliver this cleanly within 24 hours. Please assign to me!
- Deep Codebase Audit: Inspect current architecture and data flows in
Hi,
I have experience with similar implementations and would like to take this on.
Technical outline:
- Inspect repository architecture in MergeFi/frontend for an idiomatic solution.
- Implement the feature/fix with clean modular separation and robust error handling.
- Add comprehensive unit and integration test coverage for all edge cases.
- Verify that all linters, formatting, and CI checks pass cleanly.
Ready to implement immediately upon assignment. Please feel free to assign!
- added 6 commits that reference this issue
on Oct 4, 2026 Submitted fix and unit tests covering transient poll failure and mock fallback behavior via #584.
Problem
useBountyStatuspolls withfetchBounty(bountyId, fallbackBounty)fromsrc/lib/api.ts:That's right for the first server-side render (#1). Inside a polling loop, though, it means any single failed poll, such as a timeout, a 5xx or a brief network drop, resolves successfully with the static
fallbackBountysnapshot the page was rendered with.useSmartPollingthen compares it with the previous live data usinguseBountyStatus'scompareFn(status plusclaimedBy):open → claimedlive, the fallback still saysopen. The compare sees a change, sodatais replaced by the stale snapshot: the badge jumps back to "Open" andsourceflips tomock.onStatusChangefires with the stale status. Parents act on a transition that never happened. When the next poll succeeds, it fires again with the real status.fetchBountynever throws, souseSmartPolling'serroris never set.BountyStatus's "Failed to load status / Retry" branch can never render, andClaimButton's 2s claim-race polling can briefly show a claimed bounty as claimable again.Suggested fix
fallbackBounty.fetchFnuse a throwing variant, such as the underlyingrequest()/adapter, and apply the fallback only when there's no previous live result.onStatusChangeisn't called, anderroris set.Related: #1 (live vs mock distinction), #46.