Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

npm:web-push not working #23693

Closed
Octo8080X opened this issue May 4, 2024 · 13 comments · Fixed by #25261
Closed

npm:web-push not working #23693

Octo8080X opened this issue May 4, 2024 · 13 comments · Fixed by #25261
Labels
bug Something isn't working correctly

Comments

@Octo8080X
Copy link

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
Copy link
Author

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

@marvinhagemeister marvinhagemeister added the bug Something isn't working correctly label Jun 7, 2024
@ktn1234
Copy link

ktn1234 commented Jun 20, 2024

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

@cotyhamilton
Copy link
Contributor

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

@Razikus
Copy link

Razikus commented Jul 8, 2024

Same issue

@negrel
Copy link
Contributor

negrel commented Jul 13, 2024

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.

@marvinhagemeister
Copy link
Contributor

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

@cotyhamilton
Copy link
Contributor

cotyhamilton commented Jul 15, 2024

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 web-push-libs/web-push#904 but I think it needs to be fixed in deno

@marvinhagemeister
Copy link
Contributor

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

@littledivy
Copy link
Member

littledivy commented Aug 21, 2024

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

@jrmann100
Copy link

@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
Copy link

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

@littledivy littledivy reopened this Aug 28, 2024
littledivy added a commit to littledivy/deno that referenced this issue Aug 28, 2024
Fixes denoland#25260
Fixes denoland#25254
Fixes denoland#23693

Verified that `web-push` GCM decryption works in the browser.
@littledivy
Copy link
Member

littledivy commented Aug 28, 2024

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.

@jrmann100
Copy link

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

lucacasonato pushed a commit that referenced this issue Aug 29, 2024
Fixes #25260
Fixes #25254
Fixes #23693

Verified that `web-push` GCM decryption works in the browser. See
`aead-gcm-stream` changes
[here](littledivy/aead-gcm-stream@a9ffd0c)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working correctly
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants