Skip to content

Commit 82e0bd2

Browse files
committed
Finalize
1 parent f968ce2 commit 82e0bd2

3 files changed

Lines changed: 19 additions & 7 deletions

File tree

psalm-baseline.xml

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2815,7 +2815,6 @@
28152815
<code><![CDATA[PingLoop]]></code>
28162816
<code><![CDATA[PingLoop]]></code>
28172817
<code><![CDATA[PingLoop]]></code>
2818-
<code><![CDATA[PingLoop]]></code>
28192818
</PropertyNotSetInConstructor>
28202819
<UninitializedProperty>
28212820
<code><![CDATA[$this->shared]]></code>
@@ -2863,6 +2862,9 @@
28632862
</PropertyNotSetInConstructor>
28642863
</file>
28652864
<file src="src/Loop/Connection/WriteLoop.php">
2865+
<InvalidPropertyAssignmentValue>
2866+
<code><![CDATA[$this->connection->ack_queue]]></code>
2867+
</InvalidPropertyAssignmentValue>
28662868
<MixedArgument>
28672869
<code><![CDATA[$aes_iv]]></code>
28682870
<code><![CDATA[$aes_key]]></code>
@@ -3527,6 +3529,8 @@
35273529
</PossiblyNullArgument>
35283530
<PossiblyNullArrayOffset>
35293531
<code><![CDATA[$this->connection->new_outgoing]]></code>
3532+
<code><![CDATA[$this->connection->new_outgoing]]></code>
3533+
<code><![CDATA[$this->connection->unencrypted_new_outgoing]]></code>
35303534
<code><![CDATA[$this->connection->unencrypted_new_outgoing]]></code>
35313535
</PossiblyNullArrayOffset>
35323536
<PossiblyNullOperand>
@@ -3673,14 +3677,14 @@
36733677
<code><![CDATA[$args['id']['dc_id']]]></code>
36743678
<code><![CDATA[$args['madelineMsgId']]]></code>
36753679
<code><![CDATA[$args['peer']]]></code>
3676-
<code><![CDATA[$args['specialMethodType'] ?? null]]></code>
36773680
<code><![CDATA[$args['takeoutId'] ?? null]]></code>
36783681
<code><![CDATA[$args['timeout'] ?? ($this->drop ??= (float) $this->API->getSettings()->getRpc()->getRpcDropTimeout())]]></code>
36793682
<code><![CDATA[$cancellation]]></code>
36803683
<code><![CDATA[$cancellation]]></code>
36813684
<code><![CDATA[$methodInfo['subtype'] ?? null]]></code>
36823685
<code><![CDATA[$methodInfo['type']]]></code>
36833686
<code><![CDATA[$queueId]]></code>
3687+
<code><![CDATA[$special]]></code>
36843688
<code><![CDATA[$sub]]></code>
36853689
<code><![CDATA[$this->API->parseMode($args)['message']]]></code>
36863690
</MixedArgument>
@@ -3702,6 +3706,7 @@
37023706
<code><![CDATA[$methodInfo]]></code>
37033707
<code><![CDATA[$peer]]></code>
37043708
<code><![CDATA[$queueId]]></code>
3709+
<code><![CDATA[$special]]></code>
37053710
<code><![CDATA[$sub]]></code>
37063711
</MixedAssignment>
37073712
<MixedMethodCall>
@@ -3824,8 +3829,15 @@
38243829
<code><![CDATA[$this->unencrypted_check_queue ??= new WeakMap]]></code>
38253830
</PropertyTypeCoercion>
38263831
<RedundantCondition>
3827-
<code><![CDATA[\assert($message instanceof MTProtoOutgoingMessage)]]></code>
3832+
<code><![CDATA[$this->mainPendingOutgoing]]></code>
3833+
<code><![CDATA[$this->unencryptedPendingOutgoing]]></code>
3834+
<code><![CDATA[$this->uninitedPendingOutgoing]]></code>
38283835
</RedundantCondition>
3836+
<TypeDoesNotContainType>
3837+
<code><![CDATA[null]]></code>
3838+
<code><![CDATA[null]]></code>
3839+
<code><![CDATA[null]]></code>
3840+
</TypeDoesNotContainType>
38293841
</file>
38303842
<file src="src/MTProtoTools/AuthKeyHandler.php">
38313843
<MixedArgument>

src/Connection.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@ private function connect(): self
293293
$this->handler ??= new GenericLoop(function (): void {
294294
$this->handleMessages($this->new_incoming);
295295
if ($this->ack_queue) {
296-
$this->flush(); // Flush acks
296+
$this->flush(true); // Flush acks
297297
}
298298
}, "Handler loop");
299299
if (!isset($this->pinger) && !$this->shared->auth->isMedia && !$this->shared->auth->isCdn && !$this->isHttp()) {
@@ -570,10 +570,10 @@ public function sendMessage(MTProtoOutgoingMessage $message): void
570570
/**
571571
* Flush pending packets.
572572
*/
573-
public function flush(): void
573+
public function flush(bool $postpone = false): void
574574
{
575575
if (isset($this->writer)) {
576-
$this->writer->resume();
576+
$this->writer->resume($postpone);
577577
}
578578
}
579579
/**

src/MTProto/MTProtoOutgoingMessage.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ private function check(): void
240240
} else {
241241
$this->connection->check_queue[$this] = true;
242242
}
243-
$this->connection->flush();
243+
$this->connection->flush(true);
244244
}
245245
/**
246246
* Set reply to message.

0 commit comments

Comments
 (0)