Skip to content

Conversation

karlenDimla
Copy link
Contributor

Copy link
Contributor Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

Copy link
Contributor

@landomen landomen left a comment

Choose a reason for hiding this comment

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

Works as expected 👍 Left a few comments and questions, but nothing blocking this from merging

runType: RunType,
): Result<Unit> = Result.success(Unit)
): Result<Unit> = withContext(dispatcherProvider.io()) {
// onJobStarted()
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: should this be removed?

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 am actually still contemplating about it. 😅 I will remove for now. My problem here is to handle the scenario when the scan and email confirmation run together. We want to have the the callbacks running as long as one type of job is running. I need to think about that more. Will do in another task.

}

val script = pirCssScriptLoader.getScript()
maxWebViewCount = minOf(processedJobRecords.size, MAX_DETACHED_WEBVIEW_COUNT)
Copy link
Contributor

Choose a reason for hiding this comment

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

Q: what is the max detached webview count based on? Can there be an issue if for example this email confirmation is running and also scan or opt-out? In that case, theoretically there would be MAX_DETACHED_WEBVIEW_COUNT * 2 or * 3 created

Copy link
Contributor Author

@karlenDimla karlenDimla Oct 7, 2025

Choose a reason for hiding this comment

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

@landomen very good question actually. A bit of context, initially we set it to the total number of cores of the device since we were under the assumption that they will be fully parallel. However, after further investigations, we understood that they are not entirely parallel. Some interactions with the webview still has to happen and wait for the main thread(but async).

Because of this, we have been increasing and benchmarking the total number of webviews to see how much will be able to function relatively well. So far 20 has been an OK number - we will know once we get more users.

Now to the question of "Can there be an issue if for example this email confirmation is running and also scan or opt-out”, I don’t think it will be a big issue:

  1. Worst case it will be *2 (as scan/opt-outs don’t happen in parallel together).
  2. Realistically, only 4 brokers send links today so the chances of us maximizing the limit for email confirmation is low.
  3. The email confirmation webviews will be very short-lived. Majority (except for 1 broker) have simple steps for email confirmation - usually just expectation action after loading the links. Hence if we maxed it, it will just for a short time.

We can consider lessening it - but i think we could stick with the current numbers and see how it plays out in the wild. What do you think?

@karlenDimla karlenDimla merged commit 3a91465 into develop Oct 7, 2025
7 checks passed
@karlenDimla karlenDimla deleted the feature/karl/pir/resume-email-confirmation branch October 7, 2025 10:34
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