Feature/AB#32781 App List Performance Code Updates#2432
Merged
DavidBrightBcGov merged 4 commits intoMay 8, 2026
Merged
Conversation
Added GrantManagerDbWarmupService for cold starts, registered the web module so that its only affects the Web project, and not others like DbMigrator. A lot of minor tweaks to parts of the GrantApplications DataTable initialization and rendering. --Defer render is now on. --Standardized all date calls from luxon.DateTime.fromISO(...).toUTC().toLocaleString() to DateUtils.formatUtcDateToLocal(data, type); --Moved expensive object creations outside of render functions so that they're not re-run on every row render --Added type guards to more expensive render column functions that include HTML, so that when not displayed the function is not run but the internal value is still filterable.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR targets faster Grant Applications list load/render times by optimizing DataTables rendering behavior and introducing an EF Core warmup hosted service to reduce cold-start latency in the web host.
Changes:
- Adds
GrantManagerDbWarmupServiceas a web-hostIHostedServiceto pre-warm EF Core model/query pipeline and per-tenant connection/query plan caches. - Improves Grant Applications DataTable performance by enabling
deferRender, reusing render helpers, and reducing per-row work in render functions. - Extends the shared
initializeDataTablehelper to accept adeferRenderoption.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| applications/Unity.GrantManager/src/Unity.GrantManager.Web/Pages/GrantApplications/Index.js | DataTable performance adjustments (deferRender, render/type guards, caching, reduced allocations) and minor refactors. |
| applications/Unity.GrantManager/src/Unity.GrantManager.Web/GrantManagerWebModule.cs | Registers the DB warmup hosted service in the web module. |
| applications/Unity.GrantManager/src/Unity.GrantManager.EntityFrameworkCore/EntityFrameworkCore/GrantManagerDbWarmupService.cs | New background warmup service to precompile model and run a representative query per tenant. |
| applications/Unity.GrantManager/modules/Unity.Theme.UX2/src/Unity.Theme.UX2/wwwroot/themes/ux2/table-utils.js | Adds deferRender option plumbing to the shared DataTable initializer. |
Comments suppressed due to low confidence (2)
applications/Unity.GrantManager/src/Unity.GrantManager.Web/Pages/GrantApplications/Index.js:1573
- The company type description
'Registraton (Extra-pro)'appears misspelled. If this is intended to be shown to users (e.g., in exports/filters), it should be corrected to'Registration (Extra-pro)'.
function getApplicantIdColumn(columnIndex) {
return {
title: 'Applicant Id',
applications/Unity.GrantManager/src/Unity.GrantManager.Web/Pages/GrantApplications/Index.js:612
- In the Applicant Name column renderer, when
canViewApplicantsis false the display path returnsapplicantNameunescaped (line 611). Since this value can originate from user-entered data, it should be HTML-escaped in the display case as well (e.g., return the samedtTextRenderer.display(applicantName)output regardless of permission) to avoid XSS in the table cell.
getProjectSummaryColumn(columnIndex++),
getOrganizationTypeColumn(columnIndex++),
getOrganizationNameColumn(columnIndex++),
getBusinessNumberColumn(columnIndex++),
getDueDiligenceStatusColumn(columnIndex++),
getDeclineRationaleColumn(columnIndex++),
getContactFullNameColumn(columnIndex++),
getContactTitleColumn(columnIndex++),
getContactEmailColumn(columnIndex++),
getContactBusinessPhoneColumn(columnIndex++),
getContactCellPhoneColumn(columnIndex++),
getSectorSubSectorIndustryDescColumn(columnIndex++),
getSigningAuthorityFullNameColumn(columnIndex++),
getSigningAuthorityTitleColumn(columnIndex++),
getSigningAuthorityEmailColumn(columnIndex++),
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
…nd timeouts
src\Unity.GrantManager.EntityFrameworkCore\EntityFrameworkCore\DbWarmupOptions.cs
Note:
Phase 1: EF Core model compliation
Phase 2: per-tenant DB query warming.
AppSettings.json can now include the options:
"DbWarmup": {
"IsPhase2Enabled": Default true;
"MaxTenants": 0 means no limit. Default: 0.
"Phase2TimeoutSeconds": 0 means no timeout. Default: 0. Total seconds allowed for Phase 2 across all tenants before it is abandoned.
}
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Added GrantManagerDbWarmupService for cold starts, registered the web module so that its only affects the Web project, and not others like DbMigrator.
A lot of minor tweaks to parts of the GrantApplications DataTable initialization and rendering.
--Defer render is now on.
--Standardized all date calls from luxon.DateTime.fromISO(...).toUTC().toLocaleString() to DateUtils.formatUtcDateToLocal(data, type);
--Moved expensive object creations outside of render functions so that they're not re-run on every row render
--Added type guards to more expensive render column functions that include HTML, so that when not displayed the function is not run but the internal value is still filterable.