Conversation
|
I'm a bit worried about what an admin (or even SP user) will see. Am I right in that they would see all alerts for all accounts in the current service provider? We would not want that (potentially massive amount of data being returned/displayed) |
The view of alerts for 'all accounts' is pagenated with it only fetching/viewing 25 results at a time, same as things like recent-calls. Also I've tweaked the polling to check for alerts so it only fetches a maximum of 10 alerts and it uses the timestamp of the last known alert in the query so in normal use it will return an empty result. |
|
can we have an env var that disables this feature if necessary? |
|
which bit the polling or the all accounts? |
|
basically the entire feature of automatically polling for the alerts. If we deploy it on a large customer with tens or hundreds of thousands of accounts and find a performance issue I would like to be able to just disable the feature instead of roll back the entire release |
|
ok, how about making the polling interval an env var with a default of 60s and if its set to 0 that disables polling? |
uses VITE_APP_ALERT_POLL_INTERVAL default is 60s setting to 0 will disable polling
|
@davehorton dont' merge yet just need to test |
|
@davehorton all ready to merge now, if the env var is set to 0 it doens't poll, also tested with it not set (defaults to 60s) and set to 10s |
This PR will now display a badge next to the alerts menu whenever there are new alerts, it also has the webapp poll every 60s to check for new alerts.
The badge is cleared as soon as the user opens the alerts list.
The status of the last check (and therefore determination of a new alert) is held in browser local storage so logging in on a different browser will show a new badge even if the alerts were read on a different one.
I've also improved the alerts screen when logging in as admin/sp user the list of accounts now has an "All Accounts" option which show alerts on any account under the current SP, also some alerts for carriers could be created without an account so these now show up. This is consistent with things like the applications and carrier lists.
Other PRs for API Server, Feature-Server and SBCs are needed to fully support this feature.