Skip to content

Commit 54b1d27

Browse files
committed
Deduplicate the arrays before the queries
Signed-off-by: Joas Schilling <[email protected]>
1 parent e128a4d commit 54b1d27

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

lib/Push.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,7 @@ public function flushPayloads(): void {
136136
$this->deferPreparing = false;
137137

138138
if (!empty($this->loadDevicesForUsers)) {
139+
$this->loadDevicesForUsers = array_unique($this->loadDevicesForUsers);
139140
$missingDevicesFor = array_diff($this->loadDevicesForUsers, array_keys($this->userDevices));
140141
$newUserDevices = $this->getDevicesForUsers($missingDevicesFor);
141142
foreach ($missingDevicesFor as $userId) {
@@ -145,6 +146,7 @@ public function flushPayloads(): void {
145146
}
146147

147148
if (!empty($this->loadStatusForUsers)) {
149+
$this->loadStatusForUsers = array_unique($this->loadStatusForUsers);
148150
$missingStatusFor = array_diff($this->loadStatusForUsers, array_keys($this->userStatuses));
149151
$newUserStatuses = $this->userStatusManager->getUserStatuses($missingStatusFor);
150152
foreach ($missingStatusFor as $userId) {

0 commit comments

Comments
 (0)