mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-03-02 15:36:32 +00:00
Fix runAttempt not updating in job cache.
Thank you to @valldrac for finding this and diagnosing it! Fixes #13679
This commit is contained in:
committed by
Cody Henthorne
parent
7835b1d1fc
commit
cb126a2f08
@@ -200,12 +200,14 @@ class FastJobStorage(private val jobDatabase: JobDatabase) : JobStorage {
|
||||
if (job == null || !job.isMemoryOnly) {
|
||||
jobDatabase.updateJobAfterRetry(id, currentTime, runAttempt, nextBackoffInterval, serializedData)
|
||||
|
||||
// Note: All other fields are accounted for in the min spec. We only need to update from disk if serialized data changes.
|
||||
// Note: Serialized data and run attempt are the only JobSpec-specific fields that need to be updated -- the rest are in MinimalJobSpec and will be
|
||||
// updated below.
|
||||
val cached = jobSpecCache[id]
|
||||
if (cached != null && !cached.serializedData.contentEquals(serializedData)) {
|
||||
jobDatabase.getJobSpec(id)?.let {
|
||||
jobSpecCache[id] = it
|
||||
}
|
||||
if (cached != null) {
|
||||
jobSpecCache[id] = cached.copy(
|
||||
serializedData = serializedData,
|
||||
runAttempt = runAttempt
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user