mirror of
https://github.com/AsamK/signal-cli.git
synced 2026-05-13 12:30:20 +00:00
Fix sender key re-distribution on every group message (#2019)
* Fix sender key re-distribution on every group message in daemon mode sendGroupMessageInternalWithSenderKey() calls sender.send() which handles distribution and delivery, but never calls markSenderKeySharedWith() on success. SenderKeySharedStore therefore has no record that the distribution was sent, causing it to re-distribute to all recipients on every subsequent sendGroupMessage call. This results in a fresh unidentified TLS connection being opened for each group message (~6s delay per send), even for back-to-back sends to the same group. All send modes are affected: DBus daemon, JSON-RPC socket/http, and CLI send command all share the same code path. The fix mirrors the existing pattern in resendMessage() (line 307): after a successful send, record each successful recipient's address+device in the sender key shared store. * Fix sender key re-distribution on every group message SenderKeySharedStore.markSenderKeysSharedWith() stored the address using entry.toString() instead of entry.address(). Since SenderKeySharedEntry is a Java record, toString() returns the full record representation: SenderKeySharedEntry[address=<uuid>, deviceId=1] instead of just the UUID. When signal-service-java later calls getSenderKeySharedWith() and compares the retrieved addresses against the current group member UUIDs, the comparison always fails — causing the distribution message to be re-sent to all recipients on every sendGroupMessage call. This results in a fresh unidentified TLS connection being opened for each group message (~6s delay per send), even for immediate consecutive sends to the same group. All send modes are affected: DBus daemon, JSON-RPC socket/http, and the CLI send command all share the same code path. The fix is a one-character change: entry.address() instead of entry.toString().
This commit is contained in:
parent
a03d17a9e4
commit
7dc55eba81
@ -204,7 +204,7 @@ public class SenderKeySharedStore {
|
||||
).formatted(TABLE_SENDER_KEY_SHARED);
|
||||
try (final var statement = connection.prepareStatement(sql)) {
|
||||
for (final var entry : newEntries) {
|
||||
statement.setString(1, entry.toString());
|
||||
statement.setString(1, entry.address());
|
||||
statement.setInt(2, entry.deviceId());
|
||||
statement.setBytes(3, UuidUtil.toByteArray(distributionId.asUuid()));
|
||||
statement.setLong(4, System.currentTimeMillis());
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user