Skip to content
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

Draft
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

jaredperreault-okta
Copy link
Contributor

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:

script_name: testcafe-mobile
criteria: MERGE
queue_name: small
# - name: testcafe
Copy link
Contributor Author

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');
Copy link
Contributor Author

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();
Copy link
Contributor

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);
Copy link
Contributor

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 100ms? Does using 0 as the polling interval cause any issues?

const clonedPollingStep = getPollingStep(clonedTransaction);
if (clonedPollingStep !== undefined) {
clonedPollingStep.refresh = 60000;
const queuePollRequest = () => {
Copy link
Contributor

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()) {
Copy link
Contributor

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

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