Add While You Were Away session summary modal and indexer endpoint #511
No reviewers
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!511
Loading…
Reference in a new issue
No description provided.
Delete branch "issue-338-while-you-were-away"
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?
Summary
Adds the While You Were Away absent-session flow for play
/(#338):GET /v1/arena/session-summary?since_ms=&wallet=(schema 2.18.0) — stateless aggregates since a browser close timestamp: buys, unique players, podium epoch endings (winners + 4∶2∶1 prizes), optional wallet rank delta / wins / buy count.since_msclamped to 30d; future skew → 400. Podium ingest now storesblock_timestamponidx_arena_podium_epoch.localStorageclose time (yieldomega.arena.lastClosedAt.v1),visibilitychange/pagehidepersistence, glassWhileYouWereAwayModalonTimeArenaPage, indexer-first fetch viafetchArenaSessionSummary. Skips first visit, <60s absence, indexer offline, and empty summaries.Acceptance checklist
cd frontend && npm test -- src/lib/arenaSessionClose.test.tsWhileYouWereAwayModal.test.tsx+ Playwright screenshots specuseWhileYouWereAwayskips whenlastClosedAtnull; unit testsWhileYouWereAwayModal.test.tsxwywa-congratsdocs/testing/screenshots/issue-338/*.pngviaCI=1 npm run test:e2e -- --workers=1 e2e/wywa-modal-screenshots.spec.tsVerification checklist (third parties)
Indexer
Frontend
Live smoke
Manual reopen flow
/with indexer + Anvil stack; notelocalStorage['yieldomega.arena.lastClosedAt.v1']after tab hide.Docs / invariants:
INV-INDEXER-338-SESSION-SUMMARY,INV-FRONTEND-338-WYWA-MODALindocs/testing/invariants-and-business-logic.md; API indocs/indexer/design.mdandindexer/README.md; UI indocs/frontend/arena-views.md.Screenshots: docs/testing/screenshots/issue-338/
mentioned in issue #338
Security review — MR !511
Commit reviewed:
eba1e722610acff70edd8f35b3384b608b99d094Scope:
GET /v1/arena/session-summaryindexer handler + ingestblock_timestamponidx_arena_podium_epoch; frontend While You Were Away modal, localStorage close persistence, and indexer client wiring.Outcome:
FINDINGS: 0medium+Inline threads: none (no medium+ findings to anchor on the diff)
Summary
Reviewed attacker-controlled inputs (
since_ms, optionalwallet, indexer JSON rendered in the modal,localStorageclose timestamp) through SQL sinks, HTTP validation, and React rendering.walletis normalized and gated byvalid_0x_address20before reaching$1/$2binds.since_msis clamped (30d lookback, future skew → 400) and converted to a bound float timestamp — no string concatenation./v1/arena/*endpoints; optional wallet stats mirror data available via/v1/arena/wallet/{address}/stats.AddressInline(isAddressgate) and amounts throughAmountDisplay; podium labels are server-side enum mapping with safe fallback.walletis set but follows the same unauthenticated read model and DB access patterns as other arena aggregate routes; no new amplification beyond direct API use.Security review: no medium+ findings on this diff.
added 5 commits
maina7d3b64e- Merge origin/main into issue-338-while-you-were-awayCompare with previous version
Resolved merge conflict with
mainindocs/testing/invariants-and-business-logic.mdby keeping both invariant sets:INV-FRONTEND-337-BUY-EFFECT-TOASTS) frommainINV-INDEXER-338-SESSION-SUMMARY,INV-FRONTEND-338-WYWA-MODAL) from this branchSanity checks: frontend typecheck/lint + WYWA tests PASS; indexer
arena_session_summaryunit + integration tests PASS.Security review — MR !511
Commit reviewed:
a7d3b64ee4981a8d619944f0c829f9e6d1933273Scope:
GET /v1/arena/session-summaryindexer handler + ingestblock_timestamponidx_arena_podium_epoch; frontend While You Were Away modal,localStorageclose persistence, and indexer client wiring.Outcome:
FINDINGS: 0medium+Inline threads: none (no medium+ findings to anchor on the diff)
Summary
Re-reviewed attacker-controlled inputs (
since_ms, optionalwallet, indexer JSON rendered in the modal,localStorageclose timestamp) through SQL sinks, HTTP validation, and React rendering on the post-merge-conflict head.walletis normalized and gated byvalid_0x_address20before reaching$1/$2binds.since_msis clamped (30d lookback, future skew → 400) and converted to a bound float timestamp — no string concatenation./v1/arena/*endpoints; optional wallet stats mirror data available via/v1/arena/wallet/{address}/stats.AddressInline(isAddressgate) and amounts throughAmountDisplay; podium labels are server-side enum mapping with safe fallback.walletis set but follows the same unauthenticated read model and DB access patterns as other arena aggregate routes; no new amplification beyond direct API use.Security review: no medium+ findings on this diff.
added 4 commits
main0fdf405b- Merge origin/main into issue-338-while-you-were-awayCompare with previous version
Resolved merge conflicts with
main(merge commit0fdf405b).Conflict:
frontend/src/index.css— both branches added modal CSS at the same location (#338 While You Were Away vs #335 level-up celebration).Resolution: Kept both style blocks in order (WYWA modal, then level-up celebration popover). Completed the truncated WYWA
@media (max-width: 520px)rule.Sanity:
cd frontend && npm run typecheck— PASS.Security review — MR !511
Commit reviewed:
0fdf405b4e9b7ecc0400980cfe1ccabb798e0c32Scope:
GET /v1/arena/session-summaryindexer handler + ingestblock_timestamponidx_arena_podium_epoch; frontend While You Were Away modal,localStorageclose persistence, and indexer client wiring (post-merge-conflict head includingindex.cssresolution with #335).Outcome:
FINDINGS: 0medium+Inline threads: none (no medium+ findings to anchor on the diff)
Summary
Re-reviewed attacker-controlled inputs (
since_ms, optionalwallet, indexer JSON rendered in the modal,localStorageclose timestamp) through SQL sinks, HTTP validation, and React rendering on the latest MR head.walletis normalized and gated byvalid_0x_address20before reaching$1/$2binds.since_msis clamped (30d lookback, future skew → 400) and converted to a bound float timestamp — no string concatenation./v1/arena/*endpoints; optional wallet stats mirror data available via/v1/arena/wallet/{address}/stats.AddressInline(isAddressgate) and amounts throughAmountDisplay; podium labels are server-side enum mapping with safe fallback.walletis set but follows the same unauthenticated read model and DB access patterns as other arena aggregate routes; no new amplification beyond direct API use.Security review: no medium+ findings on this diff.
mentioned in commit
8821b2dfba