<feed xmlns='http://www.w3.org/2005/Atom'>
<title>claudomator.git/web/test/enable-notifications.test.mjs, branch story/task-project-fk</title>
<subtitle>claudomator — task automation server
</subtitle>
<id>https://git.terst.org/claudomator.git/atom?h=story%2Ftask-project-fk</id>
<link rel='self' href='https://git.terst.org/claudomator.git/atom?h=story%2Ftask-project-fk'/>
<link rel='alternate' type='text/html' href='https://git.terst.org/claudomator.git/'/>
<updated>2026-03-17T08:04:52+00:00</updated>
<entry>
<title>fix: unsubscribe stale push subscription before re-subscribing</title>
<updated>2026-03-17T08:04:52+00:00</updated>
<author>
<name>Claudomator Agent</name>
<email>agent@claudomator</email>
</author>
<published>2026-03-17T08:04:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.terst.org/claudomator.git/commit/?id=0db05b0fa6de318f164a1d73ddc55db9c59f1fc3'/>
<id>urn:sha1:0db05b0fa6de318f164a1d73ddc55db9c59f1fc3</id>
<content type='text'>
When the VAPID key changes (e.g. after the key-swap fix), the browser's
cached PushSubscription was created with the old key. Calling
PushManager.subscribe() with a different applicationServerKey then throws
"The provided applicationServerKey is not valid".

Fix by calling getSubscription()/unsubscribe() before subscribe() so any
stale subscription is cleared. Adds web test covering both the stale and
fresh subscription paths.

Co-Authored-By: Claude Sonnet 4.6 &lt;noreply@anthropic.com&gt;
</content>
</entry>
</feed>
