fix(service-worker): PushEvent.data has to be decoded (#19764)
PushEvent.data is not the data object itself, but an instance representing the data in wire format, with methods to synchronously decode it to JSON, ArrayBuffer, etc. NGSW assumes all push data is in JSON format. PR Close #19764
This commit is contained in:

committed by
Tobias Bosch

parent
396c2417d9
commit
3bcf0cf472
@ -224,7 +224,7 @@ export class Driver implements Debuggable, UpdateSource {
|
||||
}
|
||||
|
||||
// Handle the push and keep the SW alive until it's handled.
|
||||
msg.waitUntil(this.handlePush(msg.data));
|
||||
msg.waitUntil(this.handlePush(msg.data.json()));
|
||||
}
|
||||
|
||||
private async handleMessage(msg: MsgAny&{action: string}, from: Client): Promise<void> {
|
||||
|
Reference in New Issue
Block a user