Skip to content

core: implement transaction-status tracking and reconciliation for payments #46

Closed

Description

@EmeditWeb

Problem

After a learner signs and submits a transaction there is no reliable tracking
of its on-chain resolution. loans.store.ts has no persistence (#38), so
simulatedAmount, cached loans, and any pending payment are lost on restart.
If a repayment is submitted while the app is backgrounded or killed, it
disappears from the UI with no way to recover its status. There is no pending
-transaction queue, no status polling, and no reconciliation on resume.

Before Starting

Read ALL of these before writing any code:

  • context/architecture-context.md
  • context/code-standards.md

What To Build

A durable transaction-tracking layer:

  1. A persisted pending-transaction queue (Zustand persist / secure storage)
    recording each submitted tx hash, type, and target loan.
  2. Background/foreground status polling against the API until each tx reaches
    a terminal state (confirmed / failed / expired), with exponential backoff.
  3. Reconciliation on app resume: re-check any still-pending tx and update loan
    state accordingly, surfacing success/failure to the user.
  4. Idempotent updates so a tx confirmed while offline is not double-counted.

Files To Touch

  • stores/loans.store.ts (persistence)
  • src/transactions/* (pending queue + poller)
  • services/transactions.service.ts
  • relevant screens (pending/confirmed/failed UI)

Acceptance Criteria

  • Submitted transactions persist across restart and background/kill
  • Status polled to a terminal state with backoff
  • Pending txs reconciled on app resume and reflected in loan state
  • Updates idempotent; no double-counting on reconnect
  • Success/failure surfaced to the user; tests cover queue + reconciliation

Mandatory Checks Before Opening PR

  • All context/ files read and understood
  • npx expo export --platform web passes
  • No TypeScript errors
  • No hardcoded hex colors (constants/colors.ts only)
  • Icons from lucide-react-native only
  • Loading, error, and empty states handled
  • PR references this issue number

Activity

  1. added
    Maybe RewardedIssue may be eligible for a GrantFox reward
    GrantFox OSSIssue tracked in GrantFox OSS
    and removed
    Maybe RewardedIssue may be eligible for a GrantFox reward
    GrantFox OSSIssue tracked in GrantFox OSS
    on Jul 2, 2026
  2. julianvillalba688 commented on Jul 2, 2026

    @julianvillalba688

    Hi team,

    I would love to take on this issue. Here is a brief summary of my experience and how I plan to approach implementing durable transaction tracking and reconciliation for StepFi:

    My Experience
    As a developer experienced in building robust full-stack and mobile infrastructure, I regularly work with state persistence and asynchronous lifecycle synchronization. I have deep experience managing complex state flows with Zustand (including middleware like persist), handling idempotent database and state updates, and structuring API polling systems with exponential backoff to handle unstable network environments gracefully.

    Proposed Approach
    Durable Persistence Layer: I will update stores/loans.store.ts using Zustand's persistence middleware (integrating secure storage where sensitive/required) to ensure simulatedAmount, cached loans, and pending tx hashes survive app restarts and hard kills.

    Transaction Queue & Polling Engine (src/transactions/*): I'll create a dedicated pending-transaction queue. Once a transaction hash is generated, it will enter this persistent queue. A polling service will monitor the hashes against services/transactions.service.ts using an exponential backoff strategy until a terminal state (confirmed, failed, or expired) is reached.

    Lifecycle Reconciliation: I will hook into the app’s background/foreground lifecycle to automatically trigger a reconciliation sweep on app resume, re-verifying any outstanding pending transactions.

    Idempotency & UI/UX: I will ensure all state updates are strictly idempotent to avoid double-counting. I'll also implement clean loading, error, and empty states on the relevant screens using only lucide-react-native for iconography and constants/colors.ts for styling.

    I will strictly adhere to context/architecture-context.md and context/code-standards.md, and ensure npx expo export --platform web passes with zero TypeScript errors before opening the PR.

    Looking forward to contributing!

  3. Exploit34 commented on Jul 3, 2026

    @Exploit34

    Hi maintainer, please let me handle this issue.

  4. Joyyyb commented on Jul 4, 2026

    @Joyyyb

    ​Hi team,
    ​I’d like to take this on. I can implement the state persistence and transaction tracking missing in loans.store.ts to ensure pending payments aren't lost on restart or backgrounding.
    ​I will review the architecture and code standards files before diving into the code. I'm ready to get started!

    ​Best,
    Joyyyb

  5. Aycode01 commented on Jul 15, 2026

    @Aycode01

    Hi can I work on this

  6. Vicsygold commented on Jul 15, 2026

    @Vicsygold

    boss give me this issue abeg

  7. aojomo commented on Jul 16, 2026

    @aojomo

    Hello maintainer Emedit, i will like to work on this issue

  8. grantfox-oss commented on Jul 16, 2026

    @grantfox-oss

    🦊 GrantFox — @aojomo has been assigned to this issue as part of the Official Campaign | FWC26 campaign!

    Next steps:

    1. Open a Pull Request referencing this issue (e.g., Closes #46)
    2. Your PR will be reviewed by the StepFi-app maintainers

    Good luck! Track your progress on GrantFox.

  9. grantfox-oss commented on Sep 29, 2026

    @grantfox-oss

    🎉 This issue has been marked as completed on GrantFox!

    @aojomo's PR #52 was approved and merged by @EmeditWeb.

    🏆 @aojomo: You earned 35 FoxPoints for this contribution! Your current tier: Explorer (436 total points). Track your full progress on GrantFox.

    👏 Great work, @aojomo! Keep contributing to StepFi-app.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions