-
Notifications
You must be signed in to change notification settings - Fork 6
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
chore: bulletproofing crypto box to cc migration (WPB-14250) #3123
chore: bulletproofing crypto box to cc migration (WPB-14250) #3123
Conversation
...aphy/src/commonJvmAndroid/kotlin/com.wire.kalium.cryptography/ProteusClientCoreCryptoImpl.kt
Outdated
Show resolved
Hide resolved
Datadog ReportBranch report: ✅ 0 Failed, 3160 Passed, 107 Skipped, 37.03s Total 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.
LGTM. Would just wait for the dummy exception to be removed :D
...c/src/commonMain/kotlin/com/wire/kalium/logic/data/client/ProteusMigrationRecoveryHandler.kt
Outdated
Show resolved
Hide resolved
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.
Looking good 🏅
Just 2 questions about error code and tests
@@ -199,3 +199,6 @@ class ProteusException(message: String?, val code: Code, val intCode: Int?, caus | |||
} | |||
} | |||
} | |||
|
|||
class ProteusStorageMigrationException(override val message: String, val rootCause: Throwable? = null) : | |||
ProteusException(message, Int.MIN_VALUE, null) |
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.
Small suggestion, maybe we should have some static error code variable to not duplicate codes in future?
logic/src/commonMain/kotlin/com/wire/kalium/logic/data/client/ProteusClientProvider.kt
Show resolved
Hide resolved
Quality Gate passedIssues Measures |
* feat: cleaning all data if failure * feat: cleaning all data if failure * feat: clean up code * feat: clean up code * chore: add plan b, logout user * chore: add plan b, logout user, cleanup code * chore: cleanup code * chore: cleanup code * chore: cleanup code detekt * chore: cleanup code detekt * chore: remove exception for testing * chore: tests for new branches * chore: tests for new branches * chore: solve layer issue * chore: more test covereage * chore: layering * chore: solve missing reference * fix: deadlock while cleanup * fix: tests * fix: tests detekt
* chore: bulletproofing crypto box to cc migration (WPB-14250) (#3123) * feat: cleaning all data if failure * feat: cleaning all data if failure * feat: clean up code * feat: clean up code * chore: add plan b, logout user * chore: add plan b, logout user, cleanup code * chore: cleanup code * chore: cleanup code * chore: cleanup code detekt * chore: cleanup code detekt * chore: remove exception for testing * chore: tests for new branches * chore: tests for new branches * chore: solve layer issue * chore: more test covereage * chore: layering * chore: solve missing reference * fix: deadlock while cleanup * fix: tests * fix: tests detekt * chore: empty commit bump --------- Co-authored-by: Yamil Medina <[email protected]>
PR Submission Checklist for internal contributors
The PR Title
SQPIT-764
The PR Description
What's new in this PR?
Issues
When enabling core crypto storage, if there are any Proteus clients, we need to migrate them from CryptoBox.
Things usually don't go as planned, so we need to have a recovery plan in place.
Causes (Optional)
There might be some errors while migrating.
Solutions
Implement a recovery plan for this case:
LogoutReason
, so we can act (cleanup) accordinglyIf everything goes smoothly, the user will be prompted to login again, preserving their local history.
Dependencies (Optional)
Needs releases with:
Testing
Test Coverage (Optional)
Notes (Optional)
Note
This approach seems "more correct", since if we try to create a new device only -as the ticket suggested- we will run into the issue of the refresh token not being valid anymore, since it was associated with the broken client that we were trying to migrate. And we can't associate the previous refresh token with a different client, we get a 403.
PR Post Submission Checklist for internal contributors (Optional)
PR Post Merge Checklist for internal contributors
References
feat(conversation-list): Sort conversations by most emojis in the title #SQPIT-764
.