-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create UnifiedPush UML diagrams #37
base: master
Are you sure you want to change the base?
Changes from all commits
1be7333
a2f6fd3
9a8dfcf
05061ae
3097ecf
931a51c
57f8f9b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
@startuml unifiedPushMobile00 | ||
actor User | ||
participant MobileApp | ||
participant API | ||
database Postgres | ||
participant NtfyMobileApp | ||
participant UPServer | ||
|
||
User -> MobileApp : opens the app | ||
MobileApp -> User : asks the user to accept notifications | ||
User -> MobileApp : accepts notifications | ||
MobileApp -> User : enables notifications | ||
User -> MobileApp : tries to subscribe to notifications for a podcast | ||
MobileApp -> User : prompts the user that notifications are a \npremium-only feature and to please login | ||
User -> MobileApp : user logs in, and tries to subscribe \nto notifications for a podcast again | ||
MobileApp -> User : shows the UnifiedPush setup modal | ||
User -> MobileApp : inputs their UP endpoint hostname \nand presses the Register button | ||
MobileApp -> API : sends UP hostname in \nan authenticated request | ||
API -> API : creates UP salted_topic_id | ||
API -> Postgres : saves the UP hostname+salted_topic_id \nwith ManyToOne to User table \nin the unifiedPushToken table | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. And the API doesn't create the topic, the app receives it from the distributor, and it uses that topic. You have to treat the hostname+topic as one single URL, they're not separable. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @karmanyaahm (still learning) Podverse would be required to each notifications to each and every hostname+topic How would this properly scale? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If you need to, you can use "instances" during (MobileApp -> Distributor) registration to have an endpoint per subject. You can also get a single endpoint for the app and push a content that will help to identify the podcast subject There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
Postgres -> API : success response | ||
API -> MobileApp : returns the hostname+salted_topic_id | ||
MobileApp -> NtfyMobileApp : registers hostname+salted_topic_id | ||
NtfyMobileApp -> MobileApp : success response?? | ||
MobileApp -> User : shows UP notifications enabled message | ||
User -> MobileApp : presses the Test button | ||
MobileApp -> UPServer : posts Test notification body | ||
UPServer -> NtfyMobileApp : receives Test notification | ||
NtfyMobileApp -> User : presents Test notification to user | ||
User -> MobileApp : presses the Unregister button | ||
MobileApp -> API : sends authenticated remove unifiedPushToken request | ||
API -> API : confirms the user has permission \nto remove it | ||
API -> Postgres : sends delete unifiedPushToken \nrow request | ||
Postgres -> Postgres : deletes the unifiedPushToken row | ||
Postgres -> API : success response | ||
API -> MobileApp : success response | ||
MobileApp -> NtfyMobileApp : unregisters hostname+salted_topic_id | ||
NtfyMobileApp -> MobileApp : success response?? | ||
MobileApp -> User : shows unregister successful message | ||
|
||
@enduml |
Original file line number | Diff line number | Diff line change | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
@@ -0,0 +1,21 @@ | ||||||||||||||||
@startuml unifiedPushParser00 | ||||||||||||||||
participant Parser | ||||||||||||||||
database Postgres | ||||||||||||||||
participant UPServer | ||||||||||||||||
participant NtfyMobileApp | ||||||||||||||||
participant MobileApp | ||||||||||||||||
actor User | ||||||||||||||||
|
||||||||||||||||
Parser -> Parser : begins to parse a podcast RSS feed | ||||||||||||||||
Parser -> Parser : determines a notification \nshould be sent | ||||||||||||||||
Parser -> Postgres : queries for unifiedPushTokens \nthat should receive notifications | ||||||||||||||||
Postgres -> Parser : returns unifiedPushTokens | ||||||||||||||||
Parser -> Parser : groups the unifiedPushTokens \nby endpoint hostname | ||||||||||||||||
Parser -> UPServer : iterate over the groups\nto send unifiedPushTokens to \nbatch notify endpoints\nwith podcast and episode data\nin the request body | ||||||||||||||||
UPServer -> Parser : success response | ||||||||||||||||
UPServer -> NtfyMobileApp : pushes notification | ||||||||||||||||
NtfyMobileApp -> User : displays notification | ||||||||||||||||
User -> MobileApp : taps notification\nto open Podverse | ||||||||||||||||
Comment on lines
+16
to
+18
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||||
|
||||||||||||||||
|
||||||||||||||||
@enduml |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not User->MobileApp. The app calls the UnifiedPush library,
UnifiedPush.registerApp()
and the UnifiedPush library replies with the endpoint automatically in a call toonNewEndpoint()
- https://unifiedpush.org/developers/android/#register-for-pushThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
User -> MobileApp : selects distributor if many are available on the device
MobileApp -> UPMobileApp : asks for an UP endpoint
UPMobileApp -> MobileApp : sends the UP endpoint
MobileApp -> API : sends the UP endpoint