xen-orchestra
xen-orchestra copied to clipboard
Wip feat(xo-web): send notification
Check list
Notification Server
is a browser specific endpoint ( firebase cloud messging for chrom{e|ium} mozilla for firefox)
a subscription lookslike this :
const pushSubscription = {
endpoint: '.....',
keys: {
auth: '.....',
p256dh: '.....'
}
};
sequenceDiagram
participant notificationServer
participant serviceworker
participant front
participant backend
participant storage
Note over backend: first start
backend->>backend: Generate vapid key
backend ->> storage: store public and private vapid key
Note over backend: next start
backend ->> storage: ask for vapid keys
storage ->> backend: public and private vapid key
Note over front: register new client
front ->> backend: ask for public key
backend ->> front: public vapid key
front->>serviceworker: Register
serviceworker ->> notificationServer: Register
notificationServer ->> serviceworker: Subscription
serviceworker ->> backend: Subscription
backend ->> storage: userId, subscription
Note over backend: send notification to client
backend ->> storage: userId
loop for each subscription associated to this account
storage ->> backend: subscription
backend ->> notificationServer : subscription + payload
notificationServer ->> serviceworker: payload
serviceworker ->> front: notification
end
Check if done, if not relevant leave unchecked.
- [ ] PR reference the relevant issue (e.g.
Fixes #007
orSee xoa-support#42
) - [ ] if UI changes, a screenshot has been added to the PR
- [ ] documentation updated
-
CHANGELOG.unreleased.md
:- [ ] enhancement/bug fix entry added
- [ ] list of packages to release updated (
${name} v${new version}
)
-
I have tested added/updated features (and impacted code)
- [ ] unit tests (e.g.
cron/parse.spec.js
) - [ ] if
xo-server
API changes, the corresponding test has been added to/updated onxo-server-test
- [ ] at least manual testing
- [ ] unit tests (e.g.
Process
- create a PR as soon as possible
- mark it as
WiP:
(Work in Progress) if not ready to be merged - when you want a review, add a reviewer (and only one)
- if necessary, update your PR, and re- add a reviewer
From the Four Agreements:
- Be impeccable with your word.
- Don't take anything personally.
- Don't make assumptions.
- Always do your best.