Skip to content

The bell: every notification type, linked into the app, follow requests answerable - #2173

Open
karlitschek wants to merge 2 commits into
masterfrom
feat/bell-notifications
Open

The bell: every notification type, linked into the app, follow requests answerable#2173
karlitschek wants to merge 2 commits into
masterfrom
feat/bell-notifications

Conversation

@karlitschek

Copy link
Copy Markdown
Member

Item 8 of the fresh look. The bell already heard about mentions, favourites, boosts, follows, follow requests and edits (NotificationService::emit()), so #1631 and #1021 were closable as they stood — after checking the two types that were stored for the client API but never raised, and the one thing #1628 actually complains about.

What changes

  • poll and status reach the bell. A poll the reader voted in closing (PollService::announceClosedPolls()) and a post from an account whose bell they rang (notify on follow) were stored as notification rows and listed in the app, but Nextcloud was never told. Both are in SUBJECTS now and Notifier words them ("The poll by %s has ended", "%s posted"). A poll's author is told about their own poll closing — the one case where actor = recipient is news, and who Mastodon tells too.
  • Every entry links into this app, not out to the remote object: /apps/social/@handle/nid for a post, /apps/social/@handle for an account, built from the post's nid and the cached actor's handle (with the local username as fallback). Only when no page can be named does the remote address stay — the old behaviour, now the exception.
  • A follow request can be answered on the bell. The raised entry carries the follower's id; Notifier adds Accept (primary) and Decline actions that POST to /api/v1/follow_requests/{id}/authorize and /reject — the routes a Mastodon client uses. Answering through either route (bell, app, or client) dismisses the stored row and withdraws the bell entry (onFollowRequestAnswered(), wired into ApiController::followRequestAction()), so it does not come back on reload. An entry raised before the follower was cached (no id) still says who asked and links to them, without buttons.

Item 9 (the source block leak) turned out to be already fixed on masterPerson::exportSourceAsLocal() is separate from exportAsLocal() since 9f5e426 and PersonTest pins it — so there is nothing to ship for it.

Verification

  • Full PHP suite green (4624 tests, on the Mac), psalm no errors, php-cs-fixer clean.
  • New tests: links into the app for mention/follow/status, fallback to the remote address, nid on a follow request, poll telling its own author, the dismissal on answer (NotificationServiceTest); Accept/Decline actions with their routes and methods, no buttons without an id, the two new wordings (NotifierTest); NotifierSubjectsTest covers every subject and now uses severed_relationships as its "nothing raises this" example.
  • README and docs/Architecture.md updated. Version 0.19.37.

Closes #1631, closes #1021, closes #1628.

🤖 Generated with Claude Code

@karlitschek
karlitschek force-pushed the feat/bell-notifications branch from 4ead75e to 4244dc6 Compare September 14, 2026 00:11
Frank Karlitschek and others added 2 commits September 14, 2026 02:12
…ts answerable

Nextcloud's bell already heard about mentions, favourites, boosts, follows,
follow requests and edits. It did not hear about a poll the reader voted
in closing or a post from an account whose bell they rang — both stored
for the client API, neither raised — and every entry it did raise linked
out to the remote object rather than into this app's own page for it,
which is the complaint in #1628.

NotificationService::emit() now raises `poll` and `status` too (a poll's
author is told about their own poll closing, as on Mastodon), and builds
the link into the app — `/@handle/nid` for a post, `/@handle` for an
account — falling back to the remote address only when it cannot name a
page. A follow request carries the follower's id, and Notifier puts
Accept and Decline on the bell entry, POSTing to the same routes a
Mastodon client uses; answering through either route dismisses the stored
row and withdraws the bell entry (onFollowRequestAnswered()), so it does
not come back on the next reload.

Closes #1631 (followers reach the bell), #1021 (mentions
do) and #1628 (the entries link into the app and can be acted on).

Signed-off-by: Frank Karlitschek <frank@nextcloud.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Signed-off-by: Frank Karlitschek <frank@nextcloud.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@karlitschek
karlitschek force-pushed the feat/bell-notifications branch from 4244dc6 to 6f1a26e Compare September 14, 2026 00:12
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

Successfully merging this pull request may close these issues.

No notifications on new followers Notifications are not interactive Notification on mention

1 participant