-
Notifications
You must be signed in to change notification settings - Fork 34
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
Add a 2 second delay before shutting down the tunnel when encountering an error #1078
Add a 2 second delay before shutting down the tunnel when encountering an error #1078
Conversation
providerEvents.fire(.malformedErrorDetected(error)) | ||
try? await Task.sleep(interval: .seconds(2)) |
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 want to wait for max 2s, or do we want to focus on reliability of sending? Asking cause we could use .fire call and wait for completion, but that could take some time.
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.
Focusing on reliability is a better path here, I'll adapt the EventMapper instance such that we can await
the fire
call and remove the sleep.
EDIT: Started working on this but the change isn't trivial, I'll ping for re-review once it's ready.
Using a name like `asyncFire` isn't ideal, but otherwise this function signature perfectly matches the function it's wrapping.
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 found an issue that's causing the tunnel to get blocked "Connecting..." forever. It seems like we had a bug that only surfaced now with these changes.
Additionally I'm hesitant to go forward with these changes, since I don't think pixels should block UI/UX.
Please see the comments.
@diegoreymendez Sorry, you ran into some WIP changes that I didn't mark correctly on the PR. After our chat I've ended up reverting the WIP changes and gone back to the original approach, since I believe it will be enough to make a difference for now. |
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 tested this and it works as described. The new error messages look neat too.
Nice job @samsymons
Please review the release process for BrowserServicesKit here.
Required:
Task/Issue URL: https://app.asana.com/0/1207603085593419/1208772807738114/f
iOS PR: duckduckgo/iOS#3579
macOS PR: duckduckgo/macos-browser#3557
What kind of version bump will this require?: Patch
Description:
This PR adds a short delay when shutting down the tunnel.
Steps to test this PR:
OS Testing:
Internal references:
Software Engineering Expectations
Technical Design Template