deno icon indicating copy to clipboard operation
deno copied to clipboard

npm:web-push not working

Open Octo8080X opened this issue 1 year ago • 8 comments

Version: Deno 1.43.1

web-push is not work Deno.

AES-GCM decryption in Chrome fails and causes an error. This prevents us from receiving messages sent from the server.

We have prepared a verified repository for your reference.

https://github.com/Octo8080X/verification-web-push-on-Deno

Octo8080X avatar May 04 '24 14:05 Octo8080X

Deno 1.44.1 was used to check again, but the situation remained the same and failed.

Octo8080X avatar Jun 07 '24 17:06 Octo8080X

I am seeing this same issue too. I have a Supabase Edge Function that runs on the Deno runtime that uses web-push to my subscribed devices for notifications.

When my devices receive push notifications I receive the AES-GCM decryption failed log in the Message Decryption Failure Log section when using brave://gcm-internals/ to debug

ktn1234 avatar Jun 20 '24 00:06 ktn1234

It's almost useless, but if your payload is undefined you can at least receive the event

cotyhamilton avatar Jul 07 '24 05:07 cotyhamilton

Same issue

Razikus avatar Jul 08 '24 21:07 Razikus

Hello guys, Just letting you know that I've built from scratch a webpush package compatible with deno: https://jsr.io/@negrel/webpush Hope this can help.

negrel avatar Jul 13 '24 21:07 negrel

Just tried out the original reproduction and it works in Deno 1.45.2. I don't get the described permission error anymore 🎉

marvinhagemeister avatar Jul 15 '24 09:07 marvinhagemeister

It doesn't seem to be resolved. I have my own repo I'm testing with, but also using the repo above I'm getting the same decryption errors

Screenshot 2024-07-15 at 11 45 14 AM
deno 1.45.2 (release, aarch64-apple-darwin)
v8 12.7.224.12
typescript 5.5.2

Here's the issue on web-push side https://github.com/web-push-libs/web-push/issues/904 but I think it needs to be fixed in deno

cotyhamilton avatar Jul 15 '24 15:07 cotyhamilton

I stand corrected. I mistakenly only checked the logs in Chrome DevTools and didn't look at chrome://gcm-internals/

marvinhagemeister avatar Jul 15 '24 16:07 marvinhagemeister

We did a rewrite of the crypto code recently. This seems to be working now - not seeing any logs in chrome://gcm-internals/

deno serve --port 1234 --unstable -A ./main_deno.ts

image

littledivy avatar Aug 21 '24 17:08 littledivy

@littledivy, I'm pretty sure this is still unresolved - you need to test on localhost as 0.0.0.0 is not considered a secure context. Were you receiving notifications?

jrmann100 avatar Aug 28 '24 03:08 jrmann100

Screenshot 2024-08-27 at 8 46 43 PM Screenshot 2024-08-27 at 8 47 34 PM

jrmann100 avatar Aug 28 '24 03:08 jrmann100

Merged a fix and the push messages are now being delivered and decrypted.

Try it out with deno upgrade --canary - it will be available in an hour or two.

littledivy avatar Aug 28 '24 13:08 littledivy

Amazing, thank you! Will hope to see this in production soon.

jrmann100 avatar Aug 28 '24 15:08 jrmann100