Skip to content

Add badge to alerts#593

Merged
davehorton merged 12 commits intomainfrom
feat/alerts
Mar 30, 2026
Merged

Add badge to alerts#593
davehorton merged 12 commits intomainfrom
feat/alerts

Conversation

@sammachin
Copy link
Copy Markdown
Contributor

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.

Screen Shot 2026-03-27 at 4 38 37 PM

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.

@sammachin sammachin requested a review from davehorton as a code owner March 27, 2026 16:49
@davehorton
Copy link
Copy Markdown
Contributor

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)

@sammachin
Copy link
Copy Markdown
Contributor Author

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.
The badge will then display the number of new alerts capped at 9+ if there are 10 or more results

@davehorton
Copy link
Copy Markdown
Contributor

can we have an env var that disables this feature if necessary?

@sammachin
Copy link
Copy Markdown
Contributor Author

which bit the polling or the all accounts?

@davehorton
Copy link
Copy Markdown
Contributor

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

@sammachin
Copy link
Copy Markdown
Contributor Author

ok, how about making the polling interval an env var with a default of 60s and if its set to 0 that disables polling?
So can also change the rate using the same method

uses VITE_APP_ALERT_POLL_INTERVAL
default is 60s
setting to 0 will disable polling
@sammachin
Copy link
Copy Markdown
Contributor Author

@davehorton dont' merge yet just need to test

@sammachin
Copy link
Copy Markdown
Contributor Author

@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

@davehorton davehorton merged commit dd57a0a into main Mar 30, 2026
2 checks passed
@davehorton davehorton deleted the feat/alerts branch March 30, 2026 14:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants