-
Notifications
You must be signed in to change notification settings - Fork 319
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: polling issues on ios18 devices #3749
base: master
Are you sure you want to change the base?
Conversation
script_name: testcafe-mobile | ||
criteria: MERGE | ||
queue_name: small | ||
# - name: testcafe |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I won't merge this, this was just to get a downstream build to deploy for testing
_startAuthenticatorPolling() { | ||
console.log('queued poll action'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TODO: remove
// prevent the next poll network request from being sent | ||
this.stopPolling(); | ||
this.pausedForWindowUnfocus = true; | ||
this._handleWindowRefocusWhilePolling(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a good way to combine the two visibility listener functions so we don't need to split the logic across two methods?
const pageVisibilityHandler = () => { | ||
if (!document.hidden && this.pausedForWindowUnfocus) { | ||
this.pausedForWindowUnfocus = false; | ||
this.startPolling(100); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we have to wait 100
ms? Does using 0
as the polling interval cause any issues?
const clonedPollingStep = getPollingStep(clonedTransaction); | ||
if (clonedPollingStep !== undefined) { | ||
clonedPollingStep.refresh = 60000; | ||
const queuePollRequest = () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could this function be defined outside of the effect?
queuePollRequest(); | ||
|
||
let visListener: (() => void) | null = null; | ||
if (BrowserFeatures.isIOS()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add the same comment here that you added in the Gen2 code
Description:
When the browser window (either Safari or Chrome) is hidden during a polling flow, requests made while the browser is not active fail causing the overall flow to fail
PR Checklist
Issue:
Reviewers:
Screenshot/Video:
Downstream Monolith Build: