Repository navigation
feat: allow applications to update their messages (#302) - #1089
Open
EinfacheSache wants to merge 2 commits into
Open
EinfacheSache wants to merge 2 commits into
EinfacheSache wants to merge 2 commits into
Conversation
Adds PUT /message/{id} for the application that sent a message. The message keeps its id and date and gets an updated timestamp. Clients that connect to the stream with updates=true receive updated messages, other clients are unaffected. The web UI updates messages in place and marks them as edited.
EinfacheSache
force-pushed
the
feat/update-message
branch
from
November 19, 2026 22:40
fe8a0b2 to
2f7b9e0
Compare
Updating messages is disabled by default. It has to be enabled per
application with the new `allowMessageUpdate` setting, e.g. in the
application's edit dialog in the web UI. Otherwise `PUT /message/{id}`
returns 403.
This keeps applications push-only unless the user explicitly allows more.
An application whose token could be misused (e.g. an ssh login notifier)
can't change its messages afterwards.
On `PUT /application/{id}` an omitted `allowMessageUpdate` keeps the
current value, so existing clients don't reset it.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #302. Design: #302 (comment)
Applications can update their own messages. The message keeps its id, so progress messages ("Backup 40% … 100%") or approval requests can change in place. Deleting and re-sending gives a new id, a new notification and a new position in the list.
API
PUT /message/{id}, authenticated with an application token. The body is the same asPOST /message.allowMessageUpdatesetting (switch in the application's edit dialog, orallowMessageUpdateonPOST/PUT /application). Otherwise the request returns 403, so applications stay push-only unless the user explicitly allows more. OnPUT /application/{id}an omitted value keeps the current setting.updatedtimestamp on messages. The column is added by the existing auto-migration, and the field is omitted from JSON when unset.Stream (backwards compatible)
/stream?updates=trueadditionally receives updated messages: same id,updatedset.Web UI
updates=trueand replaces updated messages in place, in "All Messages" and in the application view, without a new desktop notification.Tests
updates=trueclients receive updates.go vet ./...,go test ./...,tsc,lint,testformatand the full UI e2e suite.I'm happy to adjust the design (e.g. PATCH semantics, or allowing client tokens).
This PR only covers updates. Applications still can't delete messages, and deletions are not sent over the stream.