Serenity 10.12.0 Release Notes (2026-12-02)
These release notes detail the changes made in Serenity and StartSharp from version 10.11.0 to 10.12.0. For a complete list of changes, please refer to the Serenity Change Log.
This release is mostly about what an application keeps, and who can see it:
- Emails that can be kept. An email of the queue can be marked as kept, so neither the cleanup job nor Purge sent removes it, and the queue page marks the kept emails and has a filter for them.
- Retention for each purpose. A purpose of the email queue can have its own days, or be kept by default, e.g. the sign-in codes for a day and the order emails for ever.
- A dashboard list that takes a permission.
Dashboards:BrowsePermissiondecides who can open the page that lists all the dashboards, and who has its links. - Interfaces without a request handler.
[GenerateInterface(RequestHandler = false)]lets a handler class stay out of the handler registration of every application, for theAddmethod of its own feature to register it. - Types of disabled features left out. The type source sees the feature toggles again, and the feature keys that are not declared anywhere are logged as the application starts.
Keeping the Emails That Matter (StartSharp)
The email queue removed the sent emails after SentRetentionDays and the failed ones after FailedRetentionDays, with
their deliveries, recipients and history, and there was no way to keep a single email that an application or a user
needed, e.g. the order confirmation of a customer, or the message that proves what was sent to them.
An email can be kept now, and neither the cleanup job nor Purge sent of the Email Queue page removes it, whatever its status is:
// with the connection of the record that the email is about
EmailQueue.Enqueue(connection, message, new EmailSendOptions { Purpose = "OrderDelivery", Keep = true });
- In the code.
EmailSendOptions.Keepkeeps the email as it is queued. An email that is sent directly, without the queue, is not affected. - In the settings.
"Keep": truefor a purpose marks its emails as kept as they are queued, see retention per purpose below. Only the emails that are queued after that are marked; the ones that are already in the queue are not changed. - On the page. Keep and Stop keeping are in the actions of an email and in the bulk actions of the selected ones. A kept email has a bookmark icon in the list and a Kept badge in its details, the Kept button next to the period filter shows only them, and its history has a Kept by or No longer kept, by event for each change.
The Purge sent dialog tells what it would do before it is confirmed: how many emails it will remove, how many old emails stay as they are kept, and how many stay as their purpose keeps them longer. The numbers follow the number of days that is chosen in the dialog.
Retention for Each Purpose
The queue kept every sent email for the same number of days, so the short-lived emails, e.g. the sign-in codes or the
two-factor codes, stayed as long as the order confirmations, or the confirmations went as early as the codes. The
purposes of the queue have their own cleanup settings now, in the EmailQueueJob:Purposes section:
"EmailQueueJob": {
"SentRetentionDays": 30,
"FailedRetentionDays": 90,
"Purposes": {
"TwoFactorCode": { "SentRetentionDays": 1 },
"OrderDelivery": { "SentRetentionDays": 0, "Keep": true }
}
}
EmailQueuePurposeSettings has the SentRetentionDays, the FailedRetentionDays and the Keep of a purpose. Zero
keeps the emails for ever, a value that is not set has the days of the section above, and a purpose that is not listed,
or an email without a purpose, keeps the behavior it had. A purpose is matched regardless of case, whichever collation
the database has.
Both the cleanup job and Purge sent honor these days: an email whose purpose is kept longer than the number of days chosen in the dialog, or for ever with 0, stays. To find the purposes, the job reads the ones that the queued emails have, so a purpose that is spelled differently in the settings doesn't leave its emails out.
Upgrading
- A migration adds the
Keptcolumn tomail_Messages, with false for the emails that are already there. - [Breaking Change] The email queue endpoint of an application,
EmailQueueEndpoint.csin the template, needs the newKeepandPurgePreviewactions. Without them, the Keep buttons of the page and the numbers in the Purge sent dialog fail. - The page, the dialog, the settings and the texts come with the packages, so nothing else is needed.
A Dashboard List With a Permission (Enterprise)
The All Dashboards page was for every signed-in user, and so was its link in the navigation menu, although the page lists only the dashboards that the user can view, so it was empty for the users who can't view any of them.
Dashboards:BrowsePermission sets a permission for the page and for both of its links, the All Dashboards item of the
navigation menu and the one in the menu of a dashboard:
"Dashboards": {
"BrowsePermission": "Dashboards:Management"
}
- When it is empty, which is the default, every signed-in user can open the page as before, and a dashboard has the All Dashboards item in its menu. The navigation link is for the users who can view one of the dashboards, or manage them, as for the others the page would be empty.
- When it is set, the page, its navigation link, and the All Dashboards item of a dashboard's menu require it. The page returns not found to the users without the permission, so it can't be told apart from a page that doesn't exist, and deleting a dashboard takes them to the home page instead of the list.
DENYremoves the page and its links altogether.
What the page lists still depends on the permissions of the dashboards themselves. A permission of a dashboard that cannot be evaluated is left out of the navigation link, so one bad value in the dashboard list cannot break the menu for everybody.
See Dashboards.
Interfaces Without a Request Handler
[GenerateInterface] generates the service interface of a class, and for a class that ends with Handler, derives from
BaseRequestHandler, or implements IRequestHandler, the interface derives from IRequestHandler as well.
AddServiceHandlers registers every IRequestHandler of the application, so a handler that needs the services of its
own feature was registered in an application that doesn't add that feature, and failed at startup in development with a
missing service.
The attribute has a RequestHandler option now, which is true by default:
// AddEmailQueue registers it, not AddServiceHandlers
[GenerateInterface(RequestHandler = false)]
public class EmailQueueHandler(/* ... */) : IEmailQueueHandler
With RequestHandler = false, the interface has the same methods, but does not derive from IRequestHandler or from
another handler interface, so only the Add method of the feature registers the class. The handlers that
Pro.Extensions registers with their own Add methods use it, so IEmailQueueHandler, IBackgroundJobHandler,
IDbSettingsHandler and IExceptionLogHandler are no longer IRequestHandlers.
An application that upgrades and calls these Add methods keeps working as it did. One that doesn't call one of them no
longer registers its handler, and starts in development instead of failing on the services that the handler needs.
Types of Disabled Features
AddApplicationPartsFeatureToggles registered the feature toggles with a factory, which the type source could not read,
so since 10.7.0 the types of a disabled feature were in the type source whatever the toggles said, e.g. the request
handlers of a feature that an application turned off were registered. The toggles are an instance again, and the type
source leaves those types out, by their assembly or by their own [RequiresFeature].
The feature keys that are queried but declared nowhere are reported through onUnknownFeature, which defaults to a
warning in the log. A key is often queried while the services are configured, before there is a logger, and those
reports were lost; they are queued and logged as the application starts now, so a typo in a feature key shows up in the
log of the first run.
An application that registers an IFeatureToggles of its own keeps it: AddApplicationPartsFeatureToggles returns
before it registers a second one, and doesn't add the hosted service that logs the unknown keys.