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

Prevent endless rekey and tunnel update cycle #897

Merged
merged 8 commits into from
Jul 30, 2024

Conversation

diegoreymendez
Copy link
Contributor

@diegoreymendez diegoreymendez commented Jul 17, 2024

Task/Issue URL: https://app.asana.com/0/1207603085593419/1207806947583090/f

iOS PR: duckduckgo/iOS#3091
macOS PR: duckduckgo/macos-browser#2987

Description

Prevents the following endless loop of calls updateTunnel > rekey > updateTunnel > rekey.

This adds noise to our metrics and is unnecessary.

Testing

See platform-specific PRs for testing instructions.

Definition of Done:


Internal references:

Pull Request Review Checklist
Software Engineering Expectations
Technical Design Template
Pull Request Documentation

@diegoreymendez diegoreymendez self-assigned this Jul 17, 2024
Task {
do {
if let delay {
try await Task<Never, Never>.sleep(interval: delay)
Copy link
Contributor

Choose a reason for hiding this comment

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

Should be able to simplify this down to Task.sleep I believe.

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'll keep it because of this, but not sure why that's even needed. 🤷

Screenshot 2024-07-30 at 11 57 48 AM

Comment on lines +1507 to +1509
#if os(macOS)
try? self.tokenStore.deleteToken()
#endif
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 need to check for system extension vs app extension here? I think it should be fine as-is, but checking anyway.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Well, if access is revoked it should be fine regardless. The only risk I see is if we get false positives as access-revoked, but then the problem would still not be this code, if that makes sense.

@diegoreymendez
Copy link
Contributor Author

I'll merge this tomorrow, to allow the internal testing week.

@diegoreymendez diegoreymendez merged commit 8623ea8 into main Jul 30, 2024
7 checks passed
@diegoreymendez diegoreymendez deleted the diego/fix-tunnel-updates branch July 30, 2024 11:06
diegoreymendez added a commit to duckduckgo/iOS that referenced this pull request Jul 30, 2024
Task/Issue URL: https://app.asana.com/0/1207603085593419/1207806947583090/f

BSK PR: duckduckgo/BrowserServicesKit#897
macOS PR: duckduckgo/macos-browser#2987

## Description

Prevents the following endless loop of calls `updateTunnel` > `rekey` > `updateTunnel` > `rekey`.

This adds noise to our metrics and is unnecessary.
diegoreymendez added a commit to duckduckgo/macos-browser that referenced this pull request Jul 30, 2024
Task/Issue URL:
https://app.asana.com/0/1207603085593419/1207806947583090/f

BSK PR: duckduckgo/BrowserServicesKit#897
iOS PR: duckduckgo/iOS#3091

## Description

Prevents the following endless loop of calls `updateTunnel` > `rekey` >
`updateTunnel` > `rekey`.

This adds noise to our metrics and is unnecessary.
samsymons added a commit that referenced this pull request Jul 31, 2024
* main:
  Prevent endless rekey and tunnel update cycle (#897)
samsymons added a commit that referenced this pull request Aug 1, 2024
* main:
  Prevent endless rekey and tunnel update cycle (#897)
  Duck player support on RMF (#914)
  Update autofill to 12.1.0 (#916)
  Report Autofill failures (#893)
  Update GRDB to 2.4.0 (upstream 6.29.0, SQLCipher 4.6.0) (#915)
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.

3 participants