Skip to content

Conversation

@conectado
Copy link
Contributor

@conectado conectado commented Sep 13, 2024

This patch adds a notification for updates for macos clients when they are on an old version.

This is how it looks:

image

The orange dot is shown regardless of the notification being dismissed.

If the notification is dismissed by the "Dismiss this version" button, until there's no new version there won't be notifications.

Updates are check at the start of firezone and every 6 hours after. This is saved in UserDefaults.

Permissions for notifications needs to be allowed so that it's show, this should be done by the requestAuthorization

Also, when an update is available a new Update available... option appears in the menu

image

This option, same as the notification takes you to the appstore.

@vercel
Copy link

vercel bot commented Sep 13, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
firezone ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 17, 2024 0:36am

@github-actions
Copy link

github-actions bot commented Sep 13, 2024

🐰 Bencher Report

Branchfeat/macos/update-notification
Testbedgithub-actions
🚨 1 ALERT: Threshold Boundary Limit exceeded!
BenchmarkMeasure
Units
ViewBenchmark Result
(Result Δ%)
Lower Boundary
(Limit %)
Upper Boundary
(Limit %)
relayed-udp-server2clientThroughput
bits/s
📈 plot
🚨 alert
🚷 threshold
314,402,011.07
(-6.55%)
315,430,130.63
(100.33%)
Click to view all benchmark results
BenchmarkThroughputBenchmark Result
bits/s
(Result Δ%)
Lower Boundary
bits/s
(Limit %)
direct-tcp-client2server📈 view plot
🚷 view threshold
271,209,618.86
(+8.24%)
232,082,905.99
(85.57%)
direct-tcp-server2client📈 view plot
🚷 view threshold
281,411,458.29
(+10.12%)
235,678,725.91
(83.75%)
direct-udp-client2server📈 view plot
🚷 view threshold
317,510,636.89
(+8.49%)
270,542,086.62
(85.21%)
direct-udp-server2client📈 view plot
🚷 view threshold
489,638,447.54
(+20.11%)
379,940,945.38
(77.60%)
relayed-tcp-client2server📈 view plot
🚷 view threshold
266,806,482.60
(+6.27%)
236,935,518.74
(88.80%)
relayed-tcp-server2client📈 view plot
🚷 view threshold
286,650,494.10
(+9.42%)
247,374,155.52
(86.30%)
relayed-udp-client2server📈 view plot
🚷 view threshold
250,451,114.19
(+6.59%)
219,077,045.59
(87.47%)
relayed-udp-server2client📈 view plot
🚨 view alert
🚷 view threshold
314,402,011.07
(-6.55%)
315,430,130.63
(100.33%)
🐰 View full continuous benchmarking report in Bencher

Copy link
Member

@thomaseizinger thomaseizinger left a comment

Choose a reason for hiding this comment

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

Nice work! I left some feedback, nothing blocking :)

}

private func startCheckingForUpdates() {
timer = Timer.scheduledTimer(timeInterval: 6 * 60 * 60, target: self, selector: #selector(checkForUpdates), userInfo: nil, repeats: true)
Copy link
Member

Choose a reason for hiding this comment

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

Might be a tad more clear to make this a class constant above

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In Rust we keep the constants as close as possible to where they are used to make it easier to find the context, I think it's good if we keep the same standard across all our platforms.

Comment on lines 124 to 126
guard let versionString = versionString.data(using: .utf8) else {
return
}
Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't this guard be combined with the one above?

Comment on lines 128 to 130
guard let versionInfo = try? JSONDecoder().decode(VersionInfo.self, from: versionString) else {
return
}
Copy link
Member

Choose a reason for hiding this comment

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

This one too.

Copy link
Member

@jamilbk jamilbk left a comment

Choose a reason for hiding this comment

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

Needs Changelog updated.

…cation.swift

Signed-off-by: Jamil <jamilbk@users.noreply.github.com>
Signed-off-by: Jamil <jamilbk@users.noreply.github.com>
@conectado conectado added this pull request to the merge queue Sep 17, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Sep 17, 2024
@conectado conectado added this pull request to the merge queue Sep 17, 2024
Merged via the queue into main with commit 9979f5a Sep 17, 2024
@conectado conectado deleted the feat/macos/update-notification branch September 17, 2024 01:43
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.

4 participants