Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Signal-Android
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
GitHub Mirror
Signal
Signal-Android
Commits
65a1d165
Commit
65a1d165
authored
4 years ago
by
Greyson Parrelli
Browse files
Options
Downloads
Patches
Plain Diff
Fix issue where storage dirty state wasn't cleared.
parent
e3b27bd3
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
app/src/main/java/org/thoughtcrime/securesms/jobs/StorageSyncJobV2.java
+9
-3
9 additions, 3 deletions
...ava/org/thoughtcrime/securesms/jobs/StorageSyncJobV2.java
with
9 additions
and
3 deletions
app/src/main/java/org/thoughtcrime/securesms/jobs/StorageSyncJobV2.java
+
9
−
3
View file @
65a1d165
...
...
@@ -206,7 +206,7 @@ public class StorageSyncJobV2 extends BaseJob {
private
boolean
performSync
()
throws
IOException
,
RetryLaterException
,
InvalidKeyException
{
Stopwatch
stopwatch
=
new
Stopwatch
(
"StorageSync"
);
Recipient
self
=
Recipient
.
self
();
Recipient
self
=
Recipient
.
self
()
.
fresh
()
;
SQLiteDatabase
db
=
DatabaseFactory
.
getInstance
(
context
).
getRawDatabase
();
SignalServiceAccountManager
accountManager
=
ApplicationDependencies
.
getSignalServiceAccountManager
();
RecipientDatabase
recipientDatabase
=
DatabaseFactory
.
getRecipientDatabase
(
context
);
...
...
@@ -236,6 +236,8 @@ public class StorageSyncJobV2 extends BaseJob {
Log
.
i
(
TAG
,
"[Remote Sync] Pre-Merge ID Difference :: "
+
idDifference
);
stopwatch
.
split
(
"remote-id-diff"
);
if
(!
idDifference
.
isEmpty
())
{
Log
.
i
(
TAG
,
"[Remote Sync] Retrieving records for key difference."
);
...
...
@@ -277,6 +279,8 @@ public class StorageSyncJobV2 extends BaseJob {
new
GroupV2RecordProcessor
(
context
).
process
(
remoteGv2
,
StorageSyncHelper
.
KEY_GENERATOR
);
new
AccountRecordProcessor
(
context
,
self
).
process
(
remoteAccount
,
StorageSyncHelper
.
KEY_GENERATOR
);
self
=
Recipient
.
self
().
fresh
();
List
<
SignalStorageRecord
>
unknownInserts
=
remoteUnknown
;
List
<
StorageId
>
unknownDeletes
=
Stream
.
of
(
idDifference
.
getLocalOnlyIds
()).
filter
(
StorageId:
:
isUnknown
).
toList
();
...
...
@@ -301,13 +305,15 @@ public class StorageSyncJobV2 extends BaseJob {
remoteInserts
,
remoteDeletes
);
recipientDatabase
.
clearDirtyStateForStorageIds
(
Util
.
concatenatedList
(
localIdsAdded
,
localIdsRemoved
));
db
.
setTransactionSuccessful
();
}
finally
{
db
.
endTransaction
();
ApplicationDependencies
.
getDatabaseObserver
().
notifyConversationListListeners
();
}
stopwatch
.
split
(
"
local-merge
"
);
stopwatch
.
split
(
"
remote-merge-transaction
"
);
Log
.
i
(
TAG
,
"[Remote Sync] WriteOperationResult :: "
+
mergeWriteOperation
);
...
...
@@ -375,7 +381,7 @@ public class StorageSyncJobV2 extends BaseJob {
db
.
endTransaction
();
}
stopwatch
.
split
(
"local-changes"
);
stopwatch
.
split
(
"local-changes
-transaction
"
);
if
(
localWriteResult
.
isPresent
())
{
Log
.
i
(
TAG
,
String
.
format
(
Locale
.
ENGLISH
,
"[Local Changes] Local changes present. %d updates, %d inserts, %d deletes, account update: %b, account insert: %b."
,
pendingUpdates
.
size
(),
pendingInsertions
.
size
(),
pendingDeletions
.
size
(),
pendingAccountUpdate
.
isPresent
(),
pendingAccountInsert
.
isPresent
()));
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment