feat: implement "what's new" and update notifications
Overview
Implements comprehensive update notification and "what's new" functionality for smtp4dev, helping users stay informed about new releases and features.
Features
What's New Notifications
- Console Banner: Displays a colorful ANSI-formatted banner on startup showing the number of new releases since the last seen version
- Web UI Dialog: Interactive dialog showing release notes with markdown formatting, timeline view, and links to GitHub
- Smart Filtering: For stable versions, shows only stable releases; for prereleases, shows matching prerelease types (e.g.,
-rcversions only see other-rcreleases) - First-Time Experience: Shows the last 10 releases for new users with no version history
Auto Update Notifications
- Daily Checks: Automatically checks for updates on startup and every 24 hours
- Persistent Notifications: Non-dismissible toast notifications in the web UI until the user acknowledges them
- Version Intelligence: When running a prerelease, also shows available stable versions as upgrade options
- Console Output: Bright yellow warning box with direct link to GitHub releases page
Settings & Configuration
New settings in the General tab:
- Disable 'What's New' notifications - Toggle to suppress what's new dialogs and notifications
- Disable update notifications - Toggle to suppress update check notifications
Both settings support:
- Server configuration via
appsettings.json - Command-line arguments:
--disablewhatsNewnotifications,--disableupdatenotifications - Environment variables:
ServerOptions__DisableWhatsNewNotifications,ServerOptions__DisableUpdateNotifications - Settings UI toggles with lock indicators
Persistence & Tracking
- Database Storage: New
UserVersionInfotable tracks last seen version, check dates, and dismissal state per user - localStorage Fallback: Anonymous users tracked via browser localStorage
- Cookie Support: Version information stored in client-side storage for stateless scenarios
Technical Implementation
Backend Components
UpdateNotificationService: Core service handling GitHub API integration, version comparison, and filtering logicUpdatesController: REST API endpoints for update checks and version trackingUserVersionInfoModel: Entity Framework model for database persistence- Database Migration: Included migration
20250915000000_AddUserVersionInfofor schema updates
Frontend Components
UpdateNotificationManager.ts: Manages periodic update checks, localStorage persistence, and callback coordinationWhatsNewDialog.vue: Vue 3 component displaying release notes with markdown rendering, timeline view, and GitHub links- Home Component Integration: Connects notification manager to toast notifications and dialog display
API Endpoints
GET /api/Updates/check?username={username}
POST /api/Updates/mark-seen?username={username}&version={version}
Console Output Example
On startup, users see:
╔════════════════════════════════════════════════════════════════╗
║ WHAT'S NEW: 3 new release(s) since last use ║
║ View release notes in the web UI or at: ║
║ https://github.com/rnwood/smtp4dev/releases ║
╚════════════════════════════════════════════════════════════════╝
Screenshots
Main Application
Settings Dialog with New Notification Options
Version Comparison Logic
The implementation includes sophisticated version comparison:
- Parses semantic versions correctly (e.g.,
3.3.0-rc.1) - Handles version prefixes (strips
vprefix automatically) - Compares prerelease suffixes properly (stable > prerelease)
- Filters releases based on current version type
Breaking Changes
None. All features are opt-in and backward compatible.
Configuration Examples
appsettings.json:
{
"ServerOptions": {
"DisableWhatsNewNotifications": false,
"DisableUpdateNotifications": false
}
}
Command Line:
smtp4dev --disablewhatsNewnotifications --disableupdatenotifications
Environment Variables:
export ServerOptions__DisableWhatsNewNotifications=true
export ServerOptions__DisableUpdateNotifications=true
Related Issue
Closes #68cc30c9
Original prompt
This section details on the original issue you should resolve
<issue_title>Implement "what's new" and update notifications.</issue_title> <issue_description># What's new
Show a message in the console with bright colours on startup with a "you've updated from x.y.z, what's new?" Link (but word it better). It should take the user to a dialog in the web UI that fetches and lists the release notes for each release since the last known version the user has used. If we are a non prerelease version, only non pre versions should be included. If we are prerelease only versions with the same -suffix and pr (if present) in the version no should be included.
There should also be a toast that does not auto dismiss in the web UI with the same. If last version is unknown then show the last 10.
Show it every time until the user either views the notes, or chooses to ignore it.
Store the version number last completed with this in the DB independedly for each user and in a cookie/localstorage otherwise.
Auto update
Every day, and on startup check for updates and show message in the console (bright) with link to the releases page and as a persistent toast in the UI. Use the same rules as above, but for pre releases, newer non pre should be included. If the check fails, show info about the disable setting.
Add a setting and command line param to suppress each of these separately. Add to settings UI.</issue_description>
Comments on the Issue (you are @copilot in this section)
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.
@copilot The build triggered by this PR has failed. Please use the Azure DevOps REST API to investigate and fix the issues.
🚨 IMPORTANT: Only proceed if this is the most recent commit on your branch. If a newer commit exists, ignore this notification.
Build Details:
- Build ID: 4313
- Build URL: https://dev.azure.com/rnwood/smtp4dev/_build/results?buildId=4313 (for reference)
- Commit: 03bcb0a
- Build Status: FAILED
Instructions for @copilot:
-
First verify this is the latest commit - If 03bcb0a is not the most recent commit in this PR branch, ignore this notification
-
Use Azure DevOps REST API to get build details and failures: `ash
Get build overview
curl -s "https://dev.azure.com/rnwood/smtp4dev/_apis/build/builds/-version=6.0" | jq '{status: .status, result: .result, sourceVersion: .sourceVersion}'
Get failed tasks and their logs
curl -s "https://dev.azure.com/rnwood/smtp4dev/_apis/build/builds/4313/timeline?api-version=6.0" | jq '.records[] | select(.result == "failed") | {name: .name, task: .task.name, errorCount: .errorCount, logId: .log.id}'
Get specific error details from a failed task log (replace LOG_ID)
curl -s "https://dev.azure.com/rnwood/smtp4dev/_apis/build/builds/4313/logs/LOG_ID" | grep -i "error|failed" `
-
Analyze the error messages from the API responses to identify compilation errors, test failures, or other issues
-
Make targeted fixes based on the specific error messages found
-
Build locally after making fixes to verify the solution
The Azure DevOps REST API provides comprehensive build failure information without requiring browser access.
📊 Code Coverage Report
| Coverage Type | Percentage | Status |
|---|---|---|
| Line Coverage | 15% | 🔴 |
| Branch Coverage | 4.9% | 🔴 |
| Method Coverage | 17.8% | 🔴 |
📁 Coverage by Namespace
| Namespace | Line Coverage | Branch Coverage | Method Coverage | Classes |
|---|---|---|---|---|
LumiSoft.Net |
0% 🔴 | 0% 🔴 | 0% 🔴 | 23 |
LumiSoft.Net.AUTH |
0% 🔴 | 0% 🔴 | 0% 🔴 | 18 |
LumiSoft.Net.IMAP |
1.7% 🔴 | 0.4% 🔴 | 3.9% 🔴 | 122 |
LumiSoft.Net.IMAP.Client |
0% 🔴 | 0% 🔴 | 0% 🔴 | 8 |
LumiSoft.Net.IMAP.Server |
0% 🔴 | 0% 🔴 | 0% 🔴 | 25 |
LumiSoft.Net.IO |
0% 🔴 | 0% 🔴 | 0% 🔴 | 13 |
LumiSoft.Net.Log |
0% 🔴 | 0% 🔴 | 0% 🔴 | 3 |
LumiSoft.Net.Mail |
0% 🔴 | 0% 🔴 | 0% 🔴 | 14 |
LumiSoft.Net.MIME |
0% 🔴 | 0% 🔴 | 0% 🔴 | 41 |
LumiSoft.Net.TCP |
0% 🔴 | 0% 🔴 | 0% 🔴 | 6 |
LumiSoft.Net.UDP |
0% 🔴 | 0% 🔴 | 0% 🔴 | 3 |
Rnwood.Smtp4dev |
1.9% 🔴 | 3.4% 🔴 | 11.3% 🔴 | 14 |
Rnwood.Smtp4dev.ApiModel |
56.6% 🔴 | 53.9% 🔴 | 40.5% 🔴 | 19 |
Rnwood.Smtp4dev.Controllers |
3.6% 🔴 | 4.9% 🔴 | 9.6% 🔴 | 11 |
Rnwood.Smtp4dev.Data |
55.8% 🔴 | 40.9% 🔴 | 61.9% 🟡 | 3 |
Rnwood.Smtp4dev.DbModel |
65.7% 🟡 | 0% 🔴 | 60.3% 🟡 | 7 |
Rnwood.Smtp4dev.DbModel.Projections |
100% 🟢 | 0% 🔴 | 100% 🟢 | 1 |
Rnwood.Smtp4dev.Hubs |
0% 🔴 | 0% 🔴 | 0% 🔴 | 1 |
Rnwood.Smtp4dev.Migrations |
89.7% 🟢 | 0% 🔴 | 69.4% 🟡 | 24 |
Rnwood.Smtp4dev.Server |
16% 🔴 | 14.7% 🔴 | 21.1% 🔴 | 14 |
Rnwood.Smtp4dev.Server.Imap |
84.8% 🟢 | 85.3% 🟢 | 78.9% 🟡 | 2 |
Rnwood.Smtp4dev.Server.Pop3 |
76.8% 🟡 | 63.6% 🟡 | 96.8% 🟢 | 2 |
Rnwood.Smtp4dev.Server.Pop3.CommandHandlers |
48.3% 🔴 | 26.1% 🔴 | 84.6% 🟢 | 12 |
Rnwood.Smtp4dev.Server.Settings |
68.3% 🟡 | 16.7% 🔴 | 73.6% 🟡 | 10 |
Rnwood.Smtp4dev.Service |
0% 🔴 | 0% 🔴 | 0% 🔴 | 2 |
Rnwood.SmtpServer |
72.1% 🟡 | 63.2% 🟡 | 68.3% 🟡 | 36 |
Rnwood.SmtpServer.Extensions |
67.9% 🟡 | 25% 🔴 | 91.3% 🟢 | 6 |
Rnwood.SmtpServer.Extensions.Auth |
59% 🔴 | 47.6% 🔴 | 57.5% 🔴 | 23 |
Rnwood.SmtpServer.Verbs |
92.9% 🟢 | 92.3% 🟢 | 100% 🟢 | 12 |
Overall Coverage Details:
- Covered Lines: 5978 / 39834
- Covered Branches: 579 / 11626
- Covered Methods: 700 / 3912
- Assemblies Tested: 3
- Total Classes: 475
Enhanced coverage report with namespace breakdown - Azure DevOps Build #3.11.0-ci20251006103_pr1901 20251006.4
