add workaround for an issue on storage sever when getting single message's expiration

pull/941/head
ryanzhao 12 months ago
parent 929e42d832
commit dba114e813

@ -254,7 +254,7 @@ extension DisappearingMessagesConfiguration {
.map { TimeInterval($0) }
#if targetEnvironment(simulator)
result.insert(
TimeInterval(2 * 60),
TimeInterval(60),
at: 0
)
result.insert(

@ -92,6 +92,11 @@ public enum GetExpirationJob: JobExecutor {
Interaction.Columns.expiresStartedAtMs.set(to: details.startedAtTimestampMs)
)
}
JobRunner.upsert(
db,
job: DisappearingMessagesJob.updateNextRunIfNeeded(db)
)
}
if !expirationInfo.isEmpty {

@ -602,6 +602,9 @@ public final class SnodeAPI {
let sendTimestamp: UInt64 = UInt64(SnodeAPI.currentOffsetTimestampMs())
// FIXME: There is a bug on SS now that a single-hash lookup is not working. Remove it when the bug is fixed
let serverHashes: [String] = serverHashes.appending("fakehash")
return SnodeAPI
.send(
request: SnodeRequest(
@ -806,8 +809,6 @@ public final class SnodeAPI {
.eraseToAnyPublisher()
}
let updatedExpiryMsWithNetworkOffset: UInt64 = UInt64(updatedExpiryMs + SnodeAPI.clockOffsetMs.wrappedValue)
return getSwarm(for: publicKey)
.tryFlatMapWithRandomSnode(retry: maxRetryCount) { snode -> AnyPublisher<[String: UpdateExpiryResponseResult], Error> in
SnodeAPI
@ -816,7 +817,7 @@ public final class SnodeAPI {
endpoint: .expire,
body: UpdateExpiryRequest(
messageHashes: serverHashes,
expiryMs: updatedExpiryMsWithNetworkOffset,
expiryMs: UInt64(updatedExpiryMs),
shorten: shortenOnly,
extend: extendOnly,
pubkey: publicKey,

Loading…
Cancel
Save