mirror of
https://github.com/signalapp/Signal-Server.git
synced 2026-12-01 10:16:47 +00:00
Update test to handle read-then-write in ContactDiscoveryWriter.
This commit is contained in:
1 parent
b080a5db4d
commit
2059bb5ef8
2 files changed
+23
-3
No files matched your search
+3
@@ -27,6 +27,9 @@ public class ContactDiscoveryWriter extends AccountDatabaseCrawlerListener {
|
||||
throws AccountDatabaseCrawlerRestartException {
|
||||
for (Account account : chunkAccounts) {
|
||||
if (account.isCanonicallyDiscoverable() != account.shouldBeVisibleInDirectory()) {
|
||||
// It’s less than ideal, but crawler listeners currently must not call update()
|
||||
// with the accounts from the chunk, because updates cause the account instance to become stale. Instead, they
|
||||
// must get a new copy, which they are free to update.
|
||||
accounts.get(account.getUuid()).ifPresent(accounts::update);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user