Merge pull request #754 from RyanRory/bug-fixes

Bug fixes
pull/769/head
RyanZhao 2 years ago committed by GitHub
commit 8d8028da13
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -198,7 +198,7 @@ final class RestoreVC: BaseVC {
do {
let hexEncodedSeed = try Mnemonic.decode(mnemonic: mnemonic)
let seed = Data(hex: hexEncodedSeed)
let (ed25519KeyPair, x25519KeyPair) = try! Identity.generate(from: seed)
let (ed25519KeyPair, x25519KeyPair) = try Identity.generate(from: seed)
Onboarding.Flow.recover.preregister(with: seed, ed25519KeyPair: ed25519KeyPair, x25519KeyPair: x25519KeyPair)
mnemonicTextView.resignFirstResponder()

@ -96,7 +96,7 @@ public enum GarbageCollectionJob: JobExecutor {
GROUP BY \(interaction[.threadId])
) AS interactionInfo ON interactionInfo.\(threadIdLiteral) = \(interaction[.threadId])
WHERE (
\(interaction[.timestampMs]) < \(timestampNow - approxSixMonthsInSeconds) AND
\(interaction[.timestampMs]) < \((timestampNow - approxSixMonthsInSeconds) * 1000) AND
interactionInfo.interactionCount >= \(minInteractionsToTrimSql)
)
)

@ -319,7 +319,7 @@ public enum MessageReceiver {
var updatedProfile: Profile = profile
// Name
if let name = name, name != profile.name {
if let name = name, !name.isEmpty, name != profile.name {
let shouldUpdate: Bool
if isCurrentUser {
shouldUpdate = given(UserDefaults.standard[.lastDisplayNameUpdate]) {

@ -53,7 +53,7 @@ extension ECKeyPair {
public extension Identity {
static func generate(from seed: Data) throws -> (ed25519KeyPair: Sign.KeyPair, x25519KeyPair: ECKeyPair) {
assert(seed.count == 16)
guard (seed.count == 16) else { throw GeneralError.invalidSeed }
let padding = Data(repeating: 0, count: 16)
guard

@ -19,6 +19,7 @@ public enum General {
}
public enum GeneralError: Error {
case invalidSeed
case keyGenerationFailed
}

Loading…
Cancel
Save