Skip to content

Feature/AB#32781 App List Performance Code Updates#2432

Merged
DavidBrightBcGov merged 4 commits into
devfrom
feature/AB#32781-app-list-performance-code-updates-10update
May 8, 2026
Merged

Feature/AB#32781 App List Performance Code Updates#2432
DavidBrightBcGov merged 4 commits into
devfrom
feature/AB#32781-app-list-performance-code-updates-10update

Conversation

@DavidBrightBcGov
Copy link
Copy Markdown
Contributor

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.

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.
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 GrantManagerDbWarmupService as a web-host IHostedService to 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 initializeDataTable helper to accept a deferRender option.

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 canViewApplicants is false the display path returns applicantName unescaped (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 same dtTextRenderer.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++),

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 8, 2026

🧪 Unit Test Results (Parallel Execution)

Tests

📊 Summary

Result Count
✅ Passed 675
❌ Failed 0
⚠️ Skipped 0

📄 HTML Reports

  • Merged Tests (HTML): Included in artifacts
    Generated automatically by CI.

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 8, 2026

🧪 Unit Test Results (Parallel Execution)

Tests

📊 Summary

Result Count
✅ Passed 675
❌ Failed 0
⚠️ Skipped 0

📄 HTML Reports

  • Merged Tests (HTML): Included in artifacts
    Generated automatically by CI.

…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.
}
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented May 8, 2026

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 8, 2026

🧪 Unit Test Results (Parallel Execution)

Tests

📊 Summary

Result Count
✅ Passed 675
❌ Failed 0
⚠️ Skipped 0

📄 HTML Reports

  • Merged Tests (HTML): Included in artifacts
    Generated automatically by CI.

@DavidBrightBcGov DavidBrightBcGov marked this pull request as ready for review May 8, 2026 20:13
@DavidBrightBcGov DavidBrightBcGov merged commit 11c53ba into dev May 8, 2026
25 checks passed
@DavidBrightBcGov DavidBrightBcGov deleted the feature/AB#32781-app-list-performance-code-updates-10update branch May 8, 2026 20: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