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.
Category: performance
Problem
In
src/app/pay/[paymentId]/page.tsx, the polling callback callssetPayment(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 callingsetPayment, skipping the update when unchanged.