[PR #979] Inform the client if it subscribes to a new topic #1484

Open
opened 2026-05-07 01:02:19 +02:00 by BreizhHardware · 0 comments

📋 Pull Request Information

Original PR: https://github.com/binwiederhier/ntfy/pull/979
Author: @karmanyaahm
Created: 12/16/2023
Status: 🔄 Open

Base: mainHead: main


📝 Commits (6)

  • 1c6aebe Reject Matrix with 200 and rejected pushkey instead of returning 5xx
  • 072520e rename UnifiedPush can't publish error to 404
  • 8f5213a keep track of topics that have never been subscribed to
  • 9bbb1ac add the "new_topic" param to the open message
  • 0d607c7 Return new_topic in open message when a fresh topic is subscribed to
  • ec79778 format

📊 Changes

8 files changed (+104 additions, -49 deletions)

View changed files

📝 server/errors.go (+2 -2)
📝 server/message_cache_test.go (+2 -2)
📝 server/server.go (+14 -14)
📝 server/server_firebase_test.go (+1 -1)
📝 server/server_matrix.go (+0 -9)
📝 server/server_test.go (+57 -7)
📝 server/topic.go (+17 -8)
📝 server/types.go (+11 -6)

📄 Description

  • Reject Matrix with 200 and rejected pushkey instead of returning 5xx
  • Set UnifiedPush 'can't publish' error to 404
  • Implement a NeverSubscribed() method in topics to keep track of new topics
  • add the "new_topic" param to the open message
  • Return new_topic in the open message when any of the list of topics subscribed to is new. Not the most information, but the likelihood of topics from the same client have different statuses is so tiny and rare, that clients can resubscribe all to be safe.

Deployment
I think the Android app needs to be released first, before the server is deployed, so the client can deal with the case of re-registration on 404.

Paired with https://github.com/binwiederhier/ntfy-android/pull/70
Closes https://github.com/binwiederhier/ntfy/issues/664


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/binwiederhier/ntfy/pull/979 **Author:** [@karmanyaahm](https://github.com/karmanyaahm) **Created:** 12/16/2023 **Status:** 🔄 Open **Base:** `main` ← **Head:** `main` --- ### 📝 Commits (6) - [`1c6aebe`](https://github.com/binwiederhier/ntfy/commit/1c6aebef6c4215a141f3454d36a3cfd67a8393ba) Reject Matrix with 200 and rejected pushkey instead of returning 5xx - [`072520e`](https://github.com/binwiederhier/ntfy/commit/072520eacc6c78bd11262ba8b141312dfbfb9cc7) rename UnifiedPush can't publish error to 404 - [`8f5213a`](https://github.com/binwiederhier/ntfy/commit/8f5213ab1a41f7e2db30bdcae84b52cf8cd1b606) keep track of topics that have never been subscribed to - [`9bbb1ac`](https://github.com/binwiederhier/ntfy/commit/9bbb1ac064d474d89e643a11e859140617c58172) add the "new_topic" param to the open message - [`0d607c7`](https://github.com/binwiederhier/ntfy/commit/0d607c7107ae42afb47c9d8e2d39e5455556b71a) Return new_topic in open message when a fresh topic is subscribed to - [`ec79778`](https://github.com/binwiederhier/ntfy/commit/ec7977891e09271e7a9085d6ab124fc9b194f0cf) format ### 📊 Changes **8 files changed** (+104 additions, -49 deletions) <details> <summary>View changed files</summary> 📝 `server/errors.go` (+2 -2) 📝 `server/message_cache_test.go` (+2 -2) 📝 `server/server.go` (+14 -14) 📝 `server/server_firebase_test.go` (+1 -1) 📝 `server/server_matrix.go` (+0 -9) 📝 `server/server_test.go` (+57 -7) 📝 `server/topic.go` (+17 -8) 📝 `server/types.go` (+11 -6) </details> ### 📄 Description - Reject Matrix with 200 and rejected pushkey instead of returning 5xx - Set UnifiedPush 'can't publish' error to 404 - Implement a NeverSubscribed() method in topics to keep track of new topics - add the "new_topic" param to the open message - Return new_topic in the open message when any of the list of topics subscribed to is new. Not the most information, but the likelihood of topics from the same client have different statuses is so tiny and rare, that clients can resubscribe all to be safe. **Deployment** I think the Android app needs to be released first, before the server is deployed, so the client can deal with the case of re-registration on 404. Paired with https://github.com/binwiederhier/ntfy-android/pull/70 Closes https://github.com/binwiederhier/ntfy/issues/664 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/ntfy#1484
No description provided.