Skip to content

fix(events): stabilize market-list pagination during live updates - #929

Merged
greatest0fallt1me merged 1 commit into
Predictify-org:mainfrom
V1ctor-o:fix/887-stable-market-pagination
Aug 29, 2026
Merged

fix(events): stabilize market-list pagination during live updates#929
greatest0fallt1me merged 1 commit into
Predictify-org:mainfrom
V1ctor-o:fix/887-stable-market-pagination

Conversation

@V1ctor-o

Copy link
Copy Markdown
Contributor

Summary

  • Preserve the currently visible market as the pagination anchor during live updates.
  • Add deterministic ID-based ordering when markets have equal sort values.
  • Validate live snapshots atomically and reject malformed or duplicate market IDs.
  • Clamp pagination after deletions, empty results, or page-size boundary changes.
  • Prevent stale concurrent refreshes from overwriting newer data.
  • Preserve last-known-good markets during refresh failures.
  • Distinguish retryable network failures from non-retryable permission failures.
  • Surface sanitized, user-visible errors without exposing upstream details.

State and failure-mode invariants

  • Invalid snapshots never partially mutate the existing market list.
  • Only the newest refresh request can commit.
  • A valid live update invalidates older in-flight refreshes.
  • Pagination always remains within a valid page range.
  • Equal sort values use market IDs as a stable tie-breaker.
  • Permission failures do not offer unsafe automatic retries.
  • Existing callers remain compatible; loadEvents() still works without arguments.

Validation

Focused validation passed:

  • 42 focused tests
  • Events store live-update and concurrency tests
  • Refresh error-state UI tests
  • Existing table empty-state tests
  • Existing virtualized-list integration tests
  • ESLint on all changed files
  • git diff --check

The repository-wide suite currently has unrelated pre-existing failures on main, including syntax errors in QuickBetPresets.tsx, CopyAddress.tsx, and other components. This change does not modify those files.

Closes #887

@drips-wave

drips-wave Bot commented Aug 29, 2026

Copy link
Copy Markdown

@V1ctor-o 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

@vercel

vercel Bot commented Aug 29, 2026

Copy link
Copy Markdown

@V1ctor-o is attempting to deploy a commit to the Jagadeesh B's projects Team on Vercel.

A member of the Team first needs to authorize it.

@greatest0fallt1me
greatest0fallt1me merged commit d2d2689 into Predictify-org:main Aug 29, 2026
0 of 2 checks passed
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.

[Quality-2][High] Make market-list pagination stable under live updates

2 participants