Skip to content

Reset in-flight payment request & delay timer on new payment request - #15

Merged
stephenmcgruer merged 1 commit into
GoogleChromeLabs:mainfrom
slde12:test-malicious-app-types
Aug 13, 2026
Merged

Reset in-flight payment request & delay timer on new payment request#15
stephenmcgruer merged 1 commit into
GoogleChromeLabs:mainfrom
slde12:test-malicious-app-types

Conversation

@slde12

@slde12 slde12 commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Previously, if consecutive payment requests invoke and close immediately before loading view finishes loading, the timer from previous payment request will try to openWindow after its timer times out.

This change fixes this by:

  • Storing delay timer ID in global currentPayment.delayTimtoutId
  • Canceling any pending timer via clearTimeout() and resetting global payment state when a new paymentrequest event arrives.
  • Resetting delayTimeoutId to null upon normal timer completion.

…request event

Previously, if consecutive payment requests invoke and close immediately before
loading view finishes loading, the timer from previous payment request will try to
openWindow after its timer times out.

This change fixes this by:
- Storing delay timer ID in global currentPayment.delayTimtoutId
- Cancling any pending timer via clearTimeout() and resetting global payment state
  when a new paymentrequest event arrives.
- Resetting delayTimeoutId to null upon normal timer completion.

@stephenmcgruer stephenmcgruer left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it feasible instead to update the service worker to handle multiple in-flight payment requests? Or is it too complicated to coordinate messages/etc in that scenario?

@stephenmcgruer

Copy link
Copy Markdown
Collaborator

Is it feasible instead to update the service worker to handle multiple in-flight payment requests? Or is it too complicated to coordinate messages/etc in that scenario?

Discussed offline, we will do this as a follow-up

@stephenmcgruer
stephenmcgruer merged commit 08a3a90 into GoogleChromeLabs:main Aug 13, 2026
6 checks passed
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.

2 participants