Skip to content

fix(core): log tenant initialization errors#9143

Merged
simeng-li merged 1 commit into
logto-io:masterfrom
NgoQuocViet2001:ngoquocviet2001-log-tenant-init-errors
Jul 10, 2026
Merged

fix(core): log tenant initialization errors#9143
simeng-li merged 1 commit into
logto-io:masterfrom
NgoQuocViet2001:ngoquocviet2001-log-tenant-init-errors

Conversation

@NgoQuocViet2001

Copy link
Copy Markdown
Contributor

Summary

  • Log tenant initialization failures to the request console before returning the error response.
  • Add a regression test for the tenantPool.get() rejection path.

Closes #5807

Testing

Unit tests

Copilot AI review requested due to automatic review settings July 2, 2026 09:58
@github-actions github-actions Bot added the bugfix label Jul 2, 2026
@github-actions

github-actions Bot commented Jul 2, 2026

Copy link
Copy Markdown

COMPARE TO master

Total Size Diff 📈 +1.34 KB

Diff by File
Name Diff
packages/core/src/app/init.test.ts 📈 +1.23 KB
packages/core/src/app/init.ts 📈 +116 Bytes

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 ensures tenant initialization failures are logged to the request-scoped console (so they appear in stdout/stderr for self-hosted deployments) and adds a regression test covering the tenantPool.get() rejection path, addressing #5807.

Changes:

  • Log tenantPool.get() initialization failures via the request console before returning an error response.
  • Add a unit test that verifies the error path returns 500 and reports the exception.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
packages/core/src/app/init.ts Logs tenant initialization errors using the request context console and continues reporting them to App Insights
packages/core/src/app/init.test.ts Adds a regression test for the tenantPool.get() rejection path and expected logging/telemetry behavior

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread packages/core/src/app/init.ts

@charIeszhao charIeszhao left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Reviewed by automation; no correctness issues found.

@simeng-li
simeng-li force-pushed the ngoquocviet2001-log-tenant-init-errors branch from 47f7d94 to 5870ff7 Compare July 8, 2026 06:40
@github-actions github-actions Bot added size/s and removed size/s labels Jul 8, 2026
@simeng-li
simeng-li merged commit ccb2796 into logto-io:master Jul 10, 2026
34 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

bug: Errors that happen during tenant initialization are not logged to console

5 participants