- Notifications
You must be signed in to change notification settings - Fork3
feat: add progress messages when creating sync sessions#139
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Merged
Uh oh!
There was an error while loading.Please reload this page.
Merged
Changes fromall commits
Commits
Show all changes
5 commits Select commitHold shift + click to select a range
72e0b05
feat: add progress messages when creating sync sessions
ethanndickson5963d9d
fixup tests
ethanndicksonc620135
tests
ethanndickson4ca3b6f
owned swift 6.1 update again
ethanndicksonea2c8a0
owned by swift 6.1 update again
ethanndicksonFile filter
Filter by extension
Conversations
Failed to load comments.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Jump to file
Failed to load files.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
7 changes: 6 additions & 1 deletionCoder-Desktop/Coder-Desktop/Preview Content/PreviewFileSync.swift
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
20 changes: 10 additions & 10 deletionsCoder-Desktop/Coder-Desktop/Preview Content/PreviewVPN.swift
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
17 changes: 9 additions & 8 deletionsCoder-Desktop/Coder-Desktop/VPN/MenuState.swift
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -18,8 +18,7 @@ struct Agent: Identifiable, Equatable, Comparable, Hashable { | ||
return lhs.wsName.localizedCompare(rhs.wsName) == .orderedAscending | ||
} | ||
let primaryHost: String | ||
} | ||
enum AgentStatus: Int, Equatable, Comparable { | ||
@@ -69,6 +68,9 @@ struct VPNMenuState { | ||
invalidAgents.append(agent) | ||
return | ||
} | ||
// Remove trailing dot if present | ||
let nonEmptyHosts = agent.fqdn.map { $0.hasSuffix(".") ? String($0.dropLast()) : $0 } | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. The array being non-empty is checked above. | ||
// An existing agent with the same name, belonging to the same workspace | ||
// is from a previous workspace build, and should be removed. | ||
agents.filter { $0.value.name == agent.name && $0.value.wsID == wsID } | ||
@@ -81,10 +83,11 @@ struct VPNMenuState { | ||
name: agent.name, | ||
// If last handshake was not within last five minutes, the agent is unhealthy | ||
status: agent.lastHandshake.date > Date.now.addingTimeInterval(-300) ? .okay : .warn, | ||
hosts: nonEmptyHosts, | ||
wsName: workspace.name, | ||
wsID: wsID, | ||
// Hosts arrive sorted by length, the shortest looks best in the UI. | ||
primaryHost: nonEmptyHosts.first! | ||
) | ||
} | ||
@@ -135,9 +138,7 @@ struct VPNMenuState { | ||
return items.sorted() | ||
} | ||
var onlineAgents: [Agent] { agents.map(\.value) } | ||
mutating func clear() { | ||
agents.removeAll() | ||
14 changes: 12 additions & 2 deletionsCoder-Desktop/Coder-Desktop/Views/FileSync/FileSyncSessionModal.swift
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
9 changes: 4 additions & 5 deletionsCoder-Desktop/Coder-Desktop/Views/VPN/VPNMenuItem.swift
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
3 changes: 2 additions & 1 deletionCoder-Desktop/Coder-DesktopTests/AgentsTests.swift
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
10 changes: 9 additions & 1 deletionCoder-Desktop/Coder-DesktopTests/FileSyncDaemonTests.swift
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
7 changes: 6 additions & 1 deletionCoder-Desktop/Coder-DesktopTests/Util.swift
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
5 changes: 4 additions & 1 deletionCoder-Desktop/VPNLib/FileSync/FileSyncDaemon.swift
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
7 changes: 5 additions & 2 deletionsCoder-Desktop/VPNLib/FileSync/FileSyncManagement.swift
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
7 changes: 6 additions & 1 deletionCoder-Desktop/VPNLib/FileSync/FileSyncPrompting.swift
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Oops, something went wrong.
Uh oh!
There was an error while loading.Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.