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

Missing call to success() or failure() in setDeviceVerification()? #1883

Open
bjorn-ove opened this issue Oct 10, 2024 · 0 comments
Open

Missing call to success() or failure() in setDeviceVerification()? #1883

bjorn-ove opened this issue Oct 10, 2024 · 0 comments

Comments

@bjorn-ove
Copy link

To me it seems there should be an else here that calls one of the completion callbacks. Or does the API not guarantee one of the callbacks is called?

if (userId == machine.userId) {
if (machine.crossSigningStatus().hasSelfSigning) {
// If we can cross sign, upload a new signature for that device
Task {
do {
try await machine.verifyDevice(userId: userId, deviceId: deviceId)
log.debug("Successfully marked device as verified")
await MainActor.run {
success?()
}
} catch {
log.error("Failed marking device as verified", context: error)
await MainActor.run {
failure?(error)
}
}
}
} else {
// It's a good time to request secrets
Task {
do {
try await machine.queryMissingSecretsFromOtherSessions()
await MainActor.run {
success?()
}
} catch {
log.error("Failed to query missing secrets", context: error)
failure?(error)
}
}
}
}

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

No branches or pull requests

1 participant