Skip to content

feat: add smart polling with claim-race detection for bounty status - #341

Merged
chonilius merged 1 commit into
MergeFi:mainfrom
Yasir-TechGuy:feature/smart-polling-46
Aug 30, 2026
Merged

feat: add smart polling with claim-race detection for bounty status#341
chonilius merged 1 commit into
MergeFi:mainfrom
Yasir-TechGuy:feature/smart-polling-46

Conversation

@Yasir-TechGuy

Copy link
Copy Markdown

…## Description
Implements smart, tab-aware polling for bounty status with claim-race detection.

Features:

  • ✅ Smart polling with backoff when data doesn't change
  • ✅ Tab-visibility awareness (pauses when backgrounded, resumes on focus)
  • ✅ Claim-race detection with clear UI messaging
  • ✅ Distinct error handling for "already claimed" scenario

Type of Change

  • New feature
  • Bug fix
  • Breaking change

Testing

  • Polling pauses when tab is backgrounded
  • Polling resumes on tab focus
  • Claim race shows specific "already claimed" message
  • Backoff reduces requests when data is unchanged

Files Added

  • src/hooks/useSmartPolling.ts - Core polling hook with backoff
  • src/hooks/useBountyStatus.ts - Bounty-specific polling
  • src/hooks/useClaimRace.ts - Claim race detection
  • src/components/bounty/BountyStatus.tsx - Status display
  • src/components/bounty/ClaimButton.tsx - Claim with race handling
  • src/types/bounty.ts - Bounty types

Acceptance Criteria

  • Bounty detail page claim status reflects changes within polling interval
  • Polling pauses when tab is backgrounded and resumes on refocus
  • Lost claim race shows specific clear message, not generic error

Notes

Full WebSocket infrastructure is out of scope per roadmap.
This is the best achievable interim UX given that constraint.

Closes #46

…Issue MergeFi#46)

- Add useSmartPolling hook with backoff and tab-visibility awareness
- Add useBountyStatus for bounty-specific polling
- Add useClaimRace for claim race detection
- Add BountyStatus component with live status display
- Add ClaimButton with clear race-lost messaging
- Polling pauses when tab is backgrounded and resumes on focus
- Clear 'already claimed' message distinct from generic errors

Closes MergeFi#46
@vercel

vercel Bot commented Aug 30, 2026

Copy link
Copy Markdown

Someone is attempting to deploy a commit to the chonilius' projects Team on Vercel.

A member of the Team first needs to authorize it.

@drips-wave

drips-wave Bot commented Aug 30, 2026

Copy link
Copy Markdown

@Yasir-TechGuy Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@Yasir-TechGuy

Copy link
Copy Markdown
Author

Hi @chonilius Please check it out

@chonilius
chonilius merged commit ec72bdc into MergeFi:main Aug 30, 2026
1 check failed
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.

Add tab-aware smart polling and claim-race detection for bounty status

2 participants