feat: update to protopiler 3.1.1

This commit is contained in:
Fedor Indutny 2026-03-11 12:36:17 -07:00
parent 1033223a79
commit 1e38725cf6
3 changed files with 11 additions and 7 deletions

View File

@ -44,7 +44,7 @@
"homepage": "https://github.com/signalapp/Mock-Signal-Server#readme",
"dependencies": {
"@indutny/parallel-prettier": "^3.0.0",
"@indutny/protopiler": "2.0.6",
"@indutny/protopiler": "3.1.1",
"@signalapp/libsignal-client": "^0.76.7",
"@tus/file-store": "^1.4.0",
"@tus/server": "^1.7.0",

View File

@ -1268,7 +1268,10 @@ export class PrimaryDevice {
}
const { senderKeyDistributionMessage } = content;
if (senderKeyDistributionMessage.length > 0) {
if (
senderKeyDistributionMessage != null &&
senderKeyDistributionMessage.length > 0
) {
handled = true;
await this.processSenderKeyDistribution(
unsealedSource,
@ -1686,8 +1689,9 @@ export class PrimaryDevice {
const envelope = Proto.Envelope.decode(encrypted);
if (
envelope.sourceServiceIdBinary != null &&
source.getServiceIdBinaryKind(envelope.sourceServiceIdBinary) !==
ServiceIdKind.ACI
ServiceIdKind.ACI
) {
throw new Error(
`Invalid envelope source. Expected: ${source.aci}, got PNI`,
@ -1705,7 +1709,7 @@ export class PrimaryDevice {
throw new Error('Unsupported envelope type');
}
const serviceIdKind = envelope.destinationServiceIdBinary.length
const serviceIdKind = envelope.destinationServiceIdBinary?.length
? this.device.getServiceIdBinaryKind(envelope.destinationServiceIdBinary)
: ServiceIdKind.ACI;
@ -1713,7 +1717,7 @@ export class PrimaryDevice {
source,
serviceIdKind,
envelopeType,
Buffer.from(envelope.content),
envelope.content ? Buffer.from(envelope.content) : Buffer.alloc(0),
);
}
@ -2005,7 +2009,7 @@ export class PrimaryDevice {
this.messageQueue.push({
source,
serviceIdKind,
body,
body: body ?? '',
envelopeType,
dataMessage,
content,

View File

@ -75,7 +75,7 @@ export abstract class Service {
throw new Error('Expected response in message');
}
const id = response.id;
const id = response.id ?? 0n;
const resolve = this.requests.get(id);
if (!resolve) {