mirror of
https://github.com/binwiederhier/ntfy.git
synced 2026-05-09 08:26:00 +02:00
[PR #609] [CLOSED] Subscriber Billed Topics #1348
Labels
No labels
ai-generated
android-app
android-app
android-app
🪲 bug
build
build
dependencies
docs
enhancement
enhancement
🔥 HOT
in-progress 🏃
ios
prio:low
prio:low
pull-request
question
🔒 security
server
server
unified-push
web-app
website
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/ntfy#1348
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/binwiederhier/ntfy/pull/609
Author: @karmanyaahm
Created: 2/14/2023
Status: ❌ Closed
Base:
main← Head:user-account📝 Commits (10+)
d686e1eUse visitor instead of UserID in topicSubscription28b654aKeep track of lastVisitor to a topicfb2fa4cFix m.Expires and prune stale topics based on lastVisitorExpires6bfe4a9Bill to visitor and set TTL in response7c5b9c0only log expiry if applicablec6b64dfremove ttlb9badeeremove TTL, will make a seperate PR36685e9Suggested changes1655f58rate limiting impl 2.0?bc3d897Use mutexes in topic📊 Changes
5 files changed (+172 additions, -64 deletions)
View changed files
📝
server/errors.go(+2 -1)📝
server/server.go(+63 -46)📝
server/server_middleware.go(+25 -1)📝
server/topic.go(+61 -14)📝
server/util.go(+21 -2)📄 Description
I am going with bill-to-last-visitor-for-12-hrs even though it doesn't allow users to unsubscribe because it is the simplest to explain. It's much easier to document and explain if you subscribe to a
up_topic, you are responsible for whatever is sent there for the next 12 hrs, so keep it secret, than anything else I could come up with.The only other simple-for-the-user options would be:
sub := func(v *visitor, msg *message) error {, so only messages you actually receive count against you. However, that allows spamming the cache with messages that no one is billed for, on the sending side.I'll add tests and rebase it and stuff if you're good with this general implementation.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.