mirror of
https://github.com/binwiederhier/ntfy.git
synced 2026-05-09 08:26:00 +02:00
[PR #1725] Add X-Persist header to control client-side local storage #1704
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#1704
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/1725
Author: @EugeneShtoka
Created: 5/4/2026
Status: 🔄 Open
Base:
main← Head:x-persist-header📝 Commits (1)
434ebbfAdd X-Persist header to control client-side local storage📊 Changes
3 files changed (+12 additions, -0 deletions)
View changed files
📝
model/model.go(+1 -0)📝
server/server.go(+1 -0)📝
server/util.go(+10 -0)📄 Description
Summary
Introduces a new
X-Persist(orPersist) publish parameter. When set tono, the server includes"persist": falsein the broadcast JSON payload, signalling clients that they should not save the message to local history.This is intentionally separate from
X-Cache(server-side caching) so that publishers can control client persistence independently:X-Cache: no— server does not cache the messageX-Persist: no— clients should not save the message to local historyA common use case is ephemeral clipboard sync or other transient notifications that should be delivered and shown, but not accumulate in message history.
Changes
model/model.go— addPersist *boolfield toMessage(omitted from JSON when nil)server/util.go— addreadOptionalBoolParamhelper returning*bool(nil when not set)server/server.go— parsex-persist/persistheader and setm.PersistRelated
Android client support: EugeneShtoka/ntfy-android#1 (respects
"persist": falseto skip local DB insert)🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.