arena: WarBow leaderboard, battle feed, and warbowRank never refresh after page mount #182
Labels
No labels
agent:fix_bugfix
agent:fix_conflicts
agent:fix_security
agent:gap_analysis
agent:implement
agent:open_issues
agents
agent:security_audit
agent:verify
area
timecurve
arena
arena-v2
audit
block:feature_review
block:security
bug
contracts
design
devops
docs
documentation
enhancement
epic
feature
frontend
indexer
low priority
megaeth
operations
ops
performance
QA
qa checklist
referrals
removal
security
smart-contracts
tech-debt
testing
time-arena
timecurve
visual-qa
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
code/yieldomega#182
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
tldr
warbowLbandwarbowFeedstate inuseTimeCurveArenaModelare fetched exactly once on component mount viauseEffect(..., [])and never refreshed. user can earn or lose hundreds of thousands of BP via buys / steals / revenge, but the rank display, leaderboard rows, and rivalry feed stay frozen at the values from page-load time.found while dogfooding the WarBow PvP loop on the QA stack.
repro
i did 2 steals taking my BP from 286,250 → 498,017. ladder still showed me Unranked.
source
frontend/src/pages/timeCurveArena/useTimeCurveArenaModel.tsx:362-378warbowRankat line 1434 derives fromwarbowLb.findIndex(...)so it's also stale:downstream consumers also affected:
warbowLeaderboardRows(line 1476), the chasing pack widget mapping at line 1529.fix shape options
(a) polling interval —
setIntervalre-fetch every ~5s while page is mounted, like indexer connectivity polling does elsewhere(b) refresh-on-tx — tap into a "tx confirmed" signal and refetch leaderboard + feed after every successful local tx
(c) manual refresh button next to the leaderboard panel (lightest)
(b) is probably the right fit — the leaderboard only meaningfully changes when the connected wallet acts or the head moves, and the existing wagmi watch on chain reads would be a natural hook point.
severity
P3 polish. data still loads, just doesn't refresh. the contract-read-backed surfaces (Your BP, Top rivals from
warbowLadderPodiumR) update correctly, so the player still gets accurate state from the most important indicators. but the indexer-backed surfaces drift away from reality the longer the page stays open.not in scope
contract-read surfaces (wagmi useReadContract) refresh fine — this only affects the indexer-backed aggregates fetched via
fetchTimecurveWarbowLeaderboardandfetchTimecurveWarbowBattleFeed.cc @PlasticDigits — found during arena dogfood. not blocking, file at your pace.
@Brouie Good finding - please retest after fix for #172 lands as we are redesgining the podium for warbow
mentioned in commit
2526541251Implemented (merged to
main, commit2526541)Code
refreshWarbowIndexerAggregatesinuseTimeCurveArenaModel.tsx: parallel fetch offetchTimecurveWarbowLeaderboard(12,0)+fetchTimecurveWarbowBattleFeed(20,0), sequence guard so stale async completions cannot overwrite newer results after unmount or overlapping refreshes.reportIndexerFetchAttemptwhenindexerBaseUrl()is set (both responses must succeed forok).VITE_INDEXER_URLis set, ~getIndexerBackoffPollMs(5000)loop (same backoff helper as Recent buys).refetchAll()now callsvoid refreshWarbowIndexerAggregates(), so successful buy / Kumbaya / WarBow steal·guard·revenge·flag /runVoidreceipts refresh indexer-backed rank + feed immediately (issue option b), plus polling covers other wallets (a).Docs / invariants
INV-FRONTEND-182-WARBOW-IDX—docs/testing/invariants-and-business-logic.md(table row + section).docs/frontend/timecurve-views.md,docs/testing/strategy.md,docs/testing/manual-qa-checklists.md(#182),skills/README.md,skills/play-timecurve-warbow/SKILL.md,.cursor/skills/yieldomega-guardrails/SKILL.md.Verification run
frontend/:npm install+npx vitest run— 302 tests passed.Checklist for QA
VITE_INDEXER_URLpoints at a live indexer; open/timecurve/arena.@brouie — please verify on your QA stack when convenient; leaving this issue open until you sign off.
verified at HEAD
5ca00ec— full pass.source spot-checks (6/6):
refreshWarbowIndexerAggregatescallback at useTimeCurveArenaModel.tsx:190warbowIndexerFetchSeqRef— monotonic ref, post-await check at :196-198 prevents stale overwritefetchTimecurveWarbowLeaderboard(12,0)+fetchTimecurveWarbowBattleFeed(20,0)reportIndexerFetchAttempt(ok)wired whenindexerBaseUrl()is setgetIndexerBackoffPollMs(3000)at :334,getIndexerBackoffPollMs(5000)at :399refetchAllchain at :1574 invokesrefreshWarbowIndexerAggregatestests:
live walk on fresh stack with active swarm + my own wallet:
0xf39Fd6…2266at battle_points_after 1750You hit the curverow rendered for the new buy at the new blockready for close on your side @PlasticDigits
mentioned in issue #164
mentioned in commit
9816f7b191mentioned in issue #211
mentioned in issue #216