Skip to content

fix: show exact deadline status from ledger time - #936

Merged
greatest0fallt1me merged 1 commit into
Predictify-org:mainfrom
Sabira2003:fix/890-ledger-deadline-status
Aug 30, 2026
Merged

fix: show exact deadline status from ledger time#936
greatest0fallt1me merged 1 commit into
Predictify-org:mainfrom
Sabira2003:fix/890-ledger-deadline-status

Conversation

@Sabira2003

Copy link
Copy Markdown
Contributor

Summary

Updates dispute deadline handling so staking and voting status is determined from authoritative Stellar ledger close time instead of the user's local browser clock.

Changes

  • Added a server-side endpoint for retrieving the latest Stellar ledger close time
  • Added deterministic ledger-time state handling
  • Updated staking deadline checks to use ledger time
  • Updated voting deadline checks to use ledger time
  • Updated countdown display to support authoritative ledger time
  • Preserved existing CountdownTimer callers through an optional currentTime prop
  • Preserved the last successful ledger snapshot when refreshes fail
  • Added loading, stale, error, permission and retry handling
  • Disabled deadline-sensitive actions when authoritative ledger time cannot be safely verified
  • Prevented older/out-of-order responses from replacing newer ledger state
  • Added focused deadline boundary and regression coverage

Deadline invariants

  • Browser wall-clock time does not determine staking or voting deadline status
  • Exact equality between ledger time and a deadline is treated as expired
  • One second before the ledger deadline remains open
  • Stale or unavailable ledger state cannot enable a deadline-sensitive action
  • Older ledger responses cannot overwrite a newer ledger snapshot
  • Existing dispute data interfaces remain unchanged

Validation

Focused deadline tests:

  • 24 tests passed
  • Ledger time overrides incorrect browser time
  • Exact deadline equality is handled deterministically
  • One-second-before-deadline boundary remains open
  • Missing ledger time shows a loading state
  • Existing countdown behaviour remains covered
  • Expired and invalid deadline handling remains covered
  • Accessibility and reduced-motion behaviour remain covered

Command:

pnpm exec jest components/disputes/shared/__tests__/CountdownTimer.test.tsx --runInBand

Result:

Test Suites: 1 passed, 1 total
Tests: 24 passed, 24 total

Repository-wide pnpm type-check was also attempted. It is currently blocked by pre-existing syntax errors in unrelated files including CopyAddress.tsx, WalletBalance.tsx, WalletMenu.tsx, QuickBetPresets.tsx, Receipt.tsx, and notifications.test.ts. None of those files are modified by this PR.

No new dependencies were added.

Closes #890

@vercel

vercel Bot commented Aug 30, 2026

Copy link
Copy Markdown

@Hakimziyech18 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.

@drips-wave

drips-wave Bot commented Aug 30, 2026

Copy link
Copy Markdown

@Sabira2003 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

@greatest0fallt1me
greatest0fallt1me merged commit 3113884 into Predictify-org: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.

[Quality-2][High] Show exact deadline status from ledger time

3 participants