mirror of
https://github.com/signalapp/Signal-Server
synced 2026-04-20 07:28:06 +01:00
Update test to handle read-then-write in ContactDiscoveryWriter.
This commit is contained in:
committed by
gram-signal
parent
b080a5db4d
commit
2059bb5ef8
@@ -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