Skip to content

Payment polling sets state unconditionally even with unchanged data #202

Description

@martinzhames

Category: performance

Problem

In src/app/pay/[paymentId]/page.tsx, the polling callback calls setPayment(data) on every successful poll with no comparison against the previous value — even if the backend returns an identical (still-pending) payload every 5 seconds.

Impact

Each poll triggers a full re-render of the page (icon, text, QR code re-evaluation) even when nothing has actually changed, which is wasted render work repeated every 5 seconds for the entire duration a customer has the tab open.

Suggested fix

Compare the new data.status (and any other displayed field) against the current state before calling setPayment, skipping the update when unchanged.

Activity

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

Metadata

Metadata

Assignees

Labels

Stellar WaveIssues in the Stellar wave program

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions