Commit Graph
3 Commits
Author SHA1 Message Date
binwiederhier e6a6049d23 Web app: notify for a message only a poll stored, and test replays end to end
A message the poll stored before its live delivery has no unread marker
yet, so the WebSocket delivery that follows marks it unread and notifies
again, while a replayed message that came in live keeps its state.

The e2e tests publish within one second and reload, so the reconnect
and the startup poll replay the earlier messages: deleted ones stay
gone, and read ones stay read without a new browser notification.
2026-10-30 21:14:26 +00:00
binwiederhier aaf8a96d55 Test the notification add paths, and replace updates the WebSocket missed
Adds unit tests for SubscriptionManager.addNotification/addNotifications and
the Poller against the real Dexie schema on an in-memory IndexedDB
(fake-indexeddb), plus e2e tests for sequence updates, deletes and clears,
messages published before subscribing, browser notifications (muted topics,
minimum priority) and a poll storing a message before the WebSocket does.

They found one bug: an update to a sequence that only the poller saw (e.g.
one the WebSocket missed) was added next to the old version instead of
replacing it, so both showed. addNotifications now replaces the stored
versions of a sequence within its transaction, keeps the update unread if
the old version was, and skips the update if a newer version is stored
already.
2026-10-07 18:43:23 +00:00
binwiederhier d7013703c1 Add Playwright end-to-end tests for the web app
Adds 56 Playwright tests in web/e2e/ that drive Chromium against a real
ntfy server: subscribing, publishing, notifications, signup/login/logout,
account settings, access tokens, reservations and languages. "make web-e2e"
builds the binary and runs them against a fresh local server; setting
NTFY_E2E_BASE_URL (plus an admin token and tier) runs them against an
existing server instead. docs/develop.md describes both.

The tests found two bugs, fixed here:

- Signup showed "Username is already taken" without the name, since it
  read the username from the error instead of the form.
- A poll that overlapped a WebSocket delivery could overwrite the stored
  message and drop its unread marker, or log a ConstraintError. Both
  write paths in SubscriptionManager now check and write in one
  transaction, and the poller skips messages that are already stored.
2026-10-07 17:26:35 +00:00