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

Deno Support #904

Open
6 of 8 tasks
cirolosapio opened this issue Jun 15, 2024 · 1 comment
Open
6 of 8 tasks

Deno Support #904

cirolosapio opened this issue Jun 15, 2024 · 1 comment

Comments

@cirolosapio
Copy link

cirolosapio commented Jun 15, 2024

Setup

web-push Version: 3.6.7

  • Chrome
  • Firefox
  • Opera for Android
  • Samsung Internet Browser
  • Other

Problem

in a deno deploy environment the sendNotification works only without a payload

Expected

it should work with payload also

Features Used

  • VAPID Support
  • GCM API Key
  • Sending with Payload

Example / Reproduce Case

server

@ktn1234
Copy link

ktn1234 commented Jul 4, 2024

I am using the following Deno version:

deno 1.44.4 (release, x86_64-apple-darwin)
v8 12.6.228.9
typescript 5.4.5

Currently, the reason why it works in Deno environment without a payload is because the browser recipient that receives the notification payload doesn't have anything to decrypt so it'll work fine.

If you add a payload, and run sendNotification in Deno environment, the browser recipient needs to decrypt the notification payload it but it can't decrypt the payload upon receiving it. This might have to do with Deno's encryption implementation details vs Node.js because it works perfectly fine for me with a payload in a Node.js environment (I tested using node v21.2.0).

If you are using chrome as the browser recipient and observe the message logs using chrome://gcm-internals and attempt to use sendNotification with a payload in a Deno environment (for me, Deno 1.44.4), you will get a AES-GCM decryption failed in the Message Decryption Failure Log like so:

Screenshot 2024-07-04 at 3 03 37 PM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants