You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Positions live in sessionStorage and are lost when the tab closes #205
frontend/script.js keeps the user's positions in memory and mirrors them to sessionStorage
(POSITION_STORAGE_KEY, line ~20). Three consequences follow:
They vanish.sessionStorage is cleared when the tab closes. A confirmed on-chain bet
disappears from the dashboard even though it is permanently recorded on Stellar.
They do not follow the user. Open the site in another browser, or on a phone, and the
position history is empty.
They can lie. The list is whatever the browser wrote locally, never reconciled against the
chain. A transaction that succeeded on chain but failed to write locally is invisible, and a
stale local entry is never corrected.
The contract exposes the real data: get_bet, get_bet_gross, get_position, get_user_bet_count, get_market_bettors_page.
Acceptance criteria
Positions are reconstructed from chain state on load, keyed by the connected address
Reconnecting the same wallet in a fresh browser shows the same positions
Local storage is a cache for responsiveness only, never the source of truth
Each position shows stake, side, market status, and payout state from the contract
Disconnecting clears the view; connecting a different wallet loads that address's positions
Why this is critical
Users cannot reliably see what they own. Combined with the missing claim flow, someone can stake
XLM and end up with no record in the UI that they ever did.
I can resolve this bug by converting position tracking in SPulse-Org / SPulse from ephemeral sessionStorage to live on-chain reconciliation.
I will update frontend/script.js to query the contract (get_position, get_bet, get_user_bet_count) upon wallet connection, making the Stellar ledger the single source of truth. Local storage will serve purely as an optimistic cache layer for fast initial renders, which will immediately re-sync with live chain state. Position views will display exact stake sizes, YES/NO side allocations, market statuses, and claimable payouts directly from the contract, updating dynamically when switching or disconnecting wallets.
I will verify the fix by placing bets, opening fresh browser tabs/incognito windows, reconnecting the wallet, and verifying that all historical positions and payout statuses render accurately from chain state. PR ready in 1 day. Closes #205.
I would love to take this on. My planned approach:
Deliver a clean, modular solution for Positions live in sessionStorage and are lost when the tab closes strictly following SPulse-Org/SPulse conventions.
Cover changes with automated tests ensuring CI passes smoothly.
Activity
Iker2522 commentedon Sep 8, 2026
I'd like to take this issue on!
I can resolve this bug by converting position tracking in SPulse-Org / SPulse from ephemeral sessionStorage to live on-chain reconciliation.
I will update frontend/script.js to query the contract (get_position, get_bet, get_user_bet_count) upon wallet connection, making the Stellar ledger the single source of truth. Local storage will serve purely as an optimistic cache layer for fast initial renders, which will immediately re-sync with live chain state. Position views will display exact stake sizes, YES/NO side allocations, market statuses, and claimable payouts directly from the contract, updating dynamically when switching or disconnecting wallets.
I will verify the fix by placing bets, opening fresh browser tabs/incognito windows, reconnecting the wallet, and verifying that all historical positions and payout statuses render accurately from chain state. PR ready in 1 day. Closes #205.
rupesh-kumar-sah commentedon Sep 13, 2026
Hi maintainers,
I would love to take this on. My planned approach:
Positions live in sessionStorage and are lost when the tab closesstrictly followingSPulse-Org/SPulseconventions.Happy to pick this up today—please assign to me!
ravimahatonp commentedon Oct 1, 2026
Hello! I would like to work on this issue.
I am interested in working on this issue.
Plan:
Positions live in sessionStorage and are lost when the tab closeswith modular design, clear documentation, and clean commit history.I am ready to start immediately—please feel free to assign this to me!