Rocksolid Light

Welcome to RetroBBS

mail  files  register  newsreader  groups  login

Message-ID:  

What is research but a blind date with knowledge? -- Will Harvey


devel / comp.lang.javascript / webpush duplicate notifications

SubjectAuthor
* webpush duplicate notificationsJan Bruns
+* Re: webpush duplicate notificationsJan Bruns
|`* Re: webpush duplicate notificationsJan Bruns
| `- Re: webpush duplicate notificationsJan Bruns
+- Re: webpush duplicate notificationsHärra Rabmo
`- Re: webpush duplicate notificationsHe, who travels time to time

1
webpush duplicate notifications

<jhig9bF9s16U1@mid.individual.net>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=17785&group=comp.lang.javascript#17785

  copy link   Newsgroups: comp.lang.javascript
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From: ebay@abnuto.de (Jan Bruns)
Newsgroups: comp.lang.javascript
Subject: webpush duplicate notifications
Date: 23 Jun 2022 06:41:47 GMT
Lines: 35
Message-ID: <jhig9bF9s16U1@mid.individual.net>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Trace: individual.net Wk8m7PYs8TKmtR6hP7lWwQKqtl7aeMKEyR3uMpfejKZVRuv6Io
Cancel-Lock: sha1:H1Wk511lMYu8cvg/ikZszynLYzs=
User-Agent: Pan/0.145 (Duplicitous mercenary valetism; d7e168a
git.gnome.org/pan2)
 by: Jan Bruns - Thu, 23 Jun 2022 06:41 UTC

Hallo,

I'm currently playing with a minimalistic webpush setup, using notifies
without payload (using service worker code to fetch the notification
cause to display).

For Desktop Chomium+FF, everything seems to work as I expected so far.

But on android, when the fon is in low power mode during the the event, I
get an additional, android generated notification (about my "app" having
had an update in the background. I've never noticed such notifications
before).

My guess is: if this prob can be solved somehow (without specific user
interaction), then it could only be the service worker js code. But I'm
completely out of ideas about what I could try. It's not
ev.preventDefault(), I guess.

If you can ignore lot's of useless console.logs, hardcoded urls/test msgs
and outdated comments from tutorial imports, you could have a look at the
service worker code here:

https://jan.abnuto.de/pushtest/service-worker.js

Well, maybe using payload notfies could also sanitize things (maybe it's
a little more clear that visile user notification is intended in that
case). But payload data would only complicate things up a lot for me,
especially given that webpush might not yet have reached stable
specification state.

Gruss

Jan Bruns

Re: webpush duplicate notifications

<jhpvbsFd85oU1@mid.individual.net>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=17793&group=comp.lang.javascript#17793

  copy link   Newsgroups: comp.lang.javascript
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From: ebay@abnuto.de (Jan Bruns)
Newsgroups: comp.lang.javascript
Subject: Re: webpush duplicate notifications
Date: 26 Jun 2022 02:42:04 GMT
Lines: 81
Message-ID: <jhpvbsFd85oU1@mid.individual.net>
References: <jhig9bF9s16U1@mid.individual.net>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Trace: individual.net lEyJ2tp+aIfxw4qOc//qXQM38fPeSplzH6/ZZyFImOWWAFHgQn
Cancel-Lock: sha1:EABsiWzCjamy1Ma3oh/HmXtvBbc=
User-Agent: Pan/0.145 (Duplicitous mercenary valetism; d7e168a
git.gnome.org/pan2)
 by: Jan Bruns - Sun, 26 Jun 2022 02:42 UTC

To clarify the question and/or ease up a similar experiment for others...

A website/client registers web-push for my domain (by calling
pushManager.subscribe()), and sends the relevant subscription data to my
Notification source server.

On that server, to send a notification, I run the command

curl -v -X POST -H "Authorization: Bearer $jwt" -H "Crypto-Key:
p256ecdsa=$pubkey" -H "TTL:0" $link

where $pubkey is the same as the one that was passed to
pushManager.subscribe(), $link is the endpoint as returned by that call,
and $jwt is some infoblock signed using the private key corresponding to
$pubkey.

A Desktop FireFox behaves exactly as expected: If it is running, it
displays the Notification (no matter if the specific site is running).
Also if it isn't running, but is coming up within the specified TTL.

For Desktop Chromium, the behaviour is similar, but if the browser window
isn't maximized and doesn't show a tab with the site, it geneates an
addional Notification about backgound activity (that I don't intend to
generate!).

https://jan.abnuto.de/pushtest/Screenshot_desktop.png

With android chromium, the behaviour is similar to desktop chromium, but
a little relaxed in terms of "browser is running" as well as "tab showing
site", but the issue remains the same:

https://jan.abnuto.de/pushtest/Screenshot_20220626-031943_Chrome.jpg

How to prevent this additional Notification?

My guess is that it is shown because of the fetch (to give the user some
impression about tracking?). But I think it can also be closed (even
though I haven't yet functional code that doesn't break cross-brwoser
compatibility).

Does it maybe have a specific tag, so that it can be updated by the real
notification?

Maybe some non-standard info I could include into the $jwt? (it's
currently only: sub,aud,exp).

Gruss

Jan Bruns

PS: this service worker was used here:
https://jan.abnuto.de/pushtest/sw2.js

and, finally, here's a perl-script that can be used to generate the jwt,
to be called like:

$(perl perl.pl "https://host-from-endpoint" "mailto:admin@notify-sender"
seconds-jwt-valid)

https://jan.abnuto.de/pushtest/perl.pl

Re: webpush duplicate notifications

<jhq7h0Fd85oU2@mid.individual.net>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=17794&group=comp.lang.javascript#17794

  copy link   Newsgroups: comp.lang.javascript
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From: ebay@abnuto.de (Jan Bruns)
Newsgroups: comp.lang.javascript
Subject: Re: webpush duplicate notifications
Date: 26 Jun 2022 05:01:20 GMT
Lines: 18
Message-ID: <jhq7h0Fd85oU2@mid.individual.net>
References: <jhig9bF9s16U1@mid.individual.net>
<jhpvbsFd85oU1@mid.individual.net>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Trace: individual.net 8j7dzwnkJVXb22aYl3vH3AulrbnI7H7FIAjUdFVzG3wo+Avb6N
Cancel-Lock: sha1:FhnhcAnBWhUeFk0/R/FQGG6Exos=
User-Agent: Pan/0.145 (Duplicitous mercenary valetism; d7e168a
git.gnome.org/pan2)
 by: Jan Bruns - Sun, 26 Jun 2022 05:01 UTC

Jan Bruns:

> PS: this service worker was used here:
> https://jan.abnuto.de/pushtest/sw2.js

Tested this version which passes a new Promise to waitUntil(), that only
gets resolved after the notification is created. But the Problem remains
the same.

https://jan.abnuto.de/pushtest/sw3.js

What else could be tried?

Gruss

Jan Bruns

Re: webpush duplicate notifications

<jht9a9F2p8rU1@mid.individual.net>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=17801&group=comp.lang.javascript#17801

  copy link   Newsgroups: comp.lang.javascript
Path: i2pn2.org!i2pn.org!news.niel.me!aioe.org!news.freedyn.de!speedkom.net!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From: ebay@abnuto.de (Jan Bruns)
Newsgroups: comp.lang.javascript
Subject: Re: webpush duplicate notifications
Date: 27 Jun 2022 08:50:17 GMT
Lines: 22
Message-ID: <jht9a9F2p8rU1@mid.individual.net>
References: <jhig9bF9s16U1@mid.individual.net>
<jhpvbsFd85oU1@mid.individual.net> <jhq7h0Fd85oU2@mid.individual.net>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Trace: individual.net bBn0zkKm+X7ssUWrwTuYaA9zQGELfDIs9WhBuUYKeiMmT8eA8q
Cancel-Lock: sha1:fY4OBN+Bqytt19hq1ikxVB+pRh0=
User-Agent: Pan/0.145 (Duplicitous mercenary valetism; d7e168a
git.gnome.org/pan2)
 by: Jan Bruns - Mon, 27 Jun 2022 08:50 UTC

Jan Bruns:

> What else could be tried?

Well, after getting payload-data to work using

https://github.com/web-push-libs/ecec

I found out that even that way (without fetch() in the service worker
code) the duplicate notification problem persisted.

And the problem was:

For Desktop Chromium, it's not enough to simply call showNotification().
The push-event also needs to be waitUntil'ed for the promise returned by
showNotification().

Gruss

Jan Bruns

Re: webpush duplicate notifications

<589be123-d6d7-48ae-8ae6-ddfc1d952468n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=17834&group=comp.lang.javascript#17834

  copy link   Newsgroups: comp.lang.javascript
X-Received: by 2002:a05:6214:d0f:b0:472:f446:4322 with SMTP id 15-20020a0562140d0f00b00472f4464322mr14147105qvh.0.1657124004902;
Wed, 06 Jul 2022 09:13:24 -0700 (PDT)
X-Received: by 2002:a05:6870:3310:b0:101:1a93:312c with SMTP id
x16-20020a056870331000b001011a93312cmr13799562oae.261.1657124004691; Wed, 06
Jul 2022 09:13:24 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.javascript
Date: Wed, 6 Jul 2022 09:13:24 -0700 (PDT)
In-Reply-To: <jhig9bF9s16U1@mid.individual.net>
Injection-Info: google-groups.googlegroups.com; posting-host=82.131.37.215; posting-account=_HrVLgoAAAAvDDvVYw-sidhilgYzxTuh
NNTP-Posting-Host: 82.131.37.215
References: <jhig9bF9s16U1@mid.individual.net>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <589be123-d6d7-48ae-8ae6-ddfc1d952468n@googlegroups.com>
Subject: Re: webpush duplicate notifications
From: ingel1983912@gmail.com (Härra Rabmo)
Injection-Date: Wed, 06 Jul 2022 16:13:24 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Lines: 46
 by: Härra Rabmo - Wed, 6 Jul 2022 16:13 UTC

Hey guy. Would You want to get rich with me doing programming? If yes, call me !!!!!!!!!

✆☎☏📱📞 : 372 53900660

Jan Bruns kirjutas Neljapäev, 23. juuni 2022 kl 08:41:55 UTC+2:
> Hallo,
>
> I'm currently playing with a minimalistic webpush setup, using notifies
> without payload (using service worker code to fetch the notification
> cause to display).
>
> For Desktop Chomium+FF, everything seems to work as I expected so far.
>
> But on android, when the fon is in low power mode during the the event, I
> get an additional, android generated notification (about my "app" having
> had an update in the background. I've never noticed such notifications
> before).
>
> My guess is: if this prob can be solved somehow (without specific user
> interaction), then it could only be the service worker js code. But I'm
> completely out of ideas about what I could try. It's not
> ev.preventDefault(), I guess.
>
> If you can ignore lot's of useless console.logs, hardcoded urls/test msgs
> and outdated comments from tutorial imports, you could have a look at the
> service worker code here:
>
> https://jan.abnuto.de/pushtest/service-worker.js
>
> Well, maybe using payload notfies could also sanitize things (maybe it's
> a little more clear that visile user notification is intended in that
> case). But payload data would only complicate things up a lot for me,
> especially given that webpush might not yet have reached stable
> specification state.
>
> Gruss
>
> Jan Bruns

Re: webpush duplicate notifications

<01e4629a-4a4d-4462-9ad4-4934b8104229n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=17941&group=comp.lang.javascript#17941

  copy link   Newsgroups: comp.lang.javascript
X-Received: by 2002:ad4:5966:0:b0:4ad:7832:a8ec with SMTP id eq6-20020ad45966000000b004ad7832a8ecmr2775115qvb.82.1663856672467;
Thu, 22 Sep 2022 07:24:32 -0700 (PDT)
X-Received: by 2002:a54:4010:0:b0:34d:8c4d:cbe6 with SMTP id
x16-20020a544010000000b0034d8c4dcbe6mr1699241oie.48.1663856671803; Thu, 22
Sep 2022 07:24:31 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.javascript
Date: Thu, 22 Sep 2022 07:24:31 -0700 (PDT)
In-Reply-To: <jhig9bF9s16U1@mid.individual.net>
Injection-Info: google-groups.googlegroups.com; posting-host=82.131.36.130; posting-account=gin_zAoAAAAxFoHHJeGbYqdKpQ_tFzq7
NNTP-Posting-Host: 82.131.36.130
References: <jhig9bF9s16U1@mid.individual.net>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <01e4629a-4a4d-4462-9ad4-4934b8104229n@googlegroups.com>
Subject: Re: webpush duplicate notifications
From: he1983912@aol.com (He, who travels time to time)
Injection-Date: Thu, 22 Sep 2022 14:24:32 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 2747
 by: He, who travels time - Thu, 22 Sep 2022 14:24 UTC

Hey... Want to talk? Call me.... My telephone number >>>>

(+372) 56330687

Jan Bruns kirjutas Neljapäev, 23. juuni 2022 kl 09:41:55 UTC+3:
> Hallo,
>
> I'm currently playing with a minimalistic webpush setup, using notifies
> without payload (using service worker code to fetch the notification
> cause to display).
>
> For Desktop Chomium+FF, everything seems to work as I expected so far.
>
> But on android, when the fon is in low power mode during the the event, I
> get an additional, android generated notification (about my "app" having
> had an update in the background. I've never noticed such notifications
> before).
>
> My guess is: if this prob can be solved somehow (without specific user
> interaction), then it could only be the service worker js code. But I'm
> completely out of ideas about what I could try. It's not
> ev.preventDefault(), I guess.
>
> If you can ignore lot's of useless console.logs, hardcoded urls/test msgs
> and outdated comments from tutorial imports, you could have a look at the
> service worker code here:
>
> https://jan.abnuto.de/pushtest/service-worker.js
>
> Well, maybe using payload notfies could also sanitize things (maybe it's
> a little more clear that visile user notification is intended in that
> case). But payload data would only complicate things up a lot for me,
> especially given that webpush might not yet have reached stable
> specification state.
>
> Gruss
>
> Jan Bruns

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor