feat(messages): write messages your users can read in the app - #258
Open
bientavu wants to merge 10 commits into
Open
feat(messages): write messages your users can read in the app#258bientavu wants to merge 10 commits into
bientavu wants to merge 10 commits into
Conversation
24 tasks
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.
Pull Request
Summary
POST /Moonfin/Broadcastwas the only way to tell users anything, and the message was not saved and only reached clients that were connected at that moment. This adds a Messages tab where an admin writes messages that are stored, scheduled and aimed at people they choose, plus the endpoints the app reads them from. Broadcast still works and is now saved too, so a message no longer disappears the moment it is sent.Related Issues
feat/server-messagesType of Change
Area
What an admin can do
Changes Made
ServerMessageinPluginConfiguration. It lives in the config next toUploadedThemesrather than in the data folder. Up to 50 are kept, and expired ones are dropped on the next save, so nothing has to run on a schedule.MoonfinThemesController:GET Moonfin/Messagesfor users, andGET,POST,DELETEunderMoonfin/Admin/MessagesbehindRequiresElevation.POST Moonfin/Admin/Messages/Ordersaves the order, the same thing asMoonfin/Collections/{id}/Order.GET Moonfin/Messages. Sending everything and hiding it in the app would let any user read a message meant for someone else. Scheduled and expired messages are left out of the payload too.POST Moonfin/Broadcastkeeps working and now saves what it sends, so users who were offline still find it.PinggainsmessagesSupported, so an older plugin simply reads as false and the client hides the button.showServerMessagesButtonin the Navigation part of the default user settings.Client Impact
Does this need matching changes in a client repo (Core, Smart-TV, Roku)?
feat/server-messagesshowServerMessagesButtonmatches the DartSyncedField('showServerMessagesButton',)inlib/data/services/synced_fields.dartexactly, including casing.Compatibility
bool?, an int toint?)MoonfinSettingsProfileonly gainsShowServerMessagesButtonas abool?, so it is additive. No migration is needed:ServerMessageis new in this PR, so nothing has ever been stored under an older shape. Older clients never call the new endpoints and ignoremessagesSupported.One ordering dependency, which is why the last box is unticked. A message push carries
route: "messages", and only a client with the matching Moongin-Core PR knows what to do with it.Testing
Test Steps
Screenshots (if applicable)
Checklist