Skip to content

fix(core): coalesce orphan-tx warnings in ModelDb.addTxes#10927

Open
MichaelUray wants to merge 2 commits into
hcengineering:developfrom
MichaelUray:feat/core-memdb-orphan-tx-coalesce
Open

fix(core): coalesce orphan-tx warnings in ModelDb.addTxes#10927
MichaelUray wants to merge 2 commits into
hcengineering:developfrom
MichaelUray:feat/core-memdb-orphan-tx-coalesce

Conversation

@MichaelUray

@MichaelUray MichaelUray commented Jun 25, 2026

Copy link
Copy Markdown

Summary

ModelDb.addTxes currently emits one ctx.warn('no document found, failed to apply model transaction, skipping') for every orphan-targeted transaction the loader skips. On workspaces that have evolved through multiple model versions this produces dozens of identical-looking warnings on every page load, drowning out real warnings without giving operators an actionable signal.

Change

Drop the three per-tx ctx.warn(...) calls in the create/update/remove branches; accumulate the orphan count plus a transaction-class breakdown locally, then emit a single coalesced ctx.info at the end of addTxes:

message: skipped model transactions for orphan documents
args: { total: 4, byClass: { "core.class.TxUpdateDoc": 3, "core.class.TxRemoveDoc": 1 } }

The diagnostic information needed for migration debugging is still present — just consolidated into one log line per call instead of M.

Why info instead of warn

Orphan-targeted transactions on long-lived workspaces are an expected outcome of model evolution (objects renamed/removed across versions). They are not actionable for operators on each load. warn is reserved for events that need attention.

Tests

memdb.test.ts adds focused coverage for the coalescing behaviour:

  • a batch with multiple orphan-targeted transactions emits one coalesced ctx.info record
  • the total count and concrete byClass breakdown (TxUpdateDoc / TxRemoveDoc) are asserted
  • legacy per-transaction no document found warnings are no longer emitted
  • a clean addTxes call (no orphans) emits no orphan summary

DCO

Signed-off-by Michael Uray. maintainer_can_modify=true.

Per-TX 'no document found' warnings were previously emitted via ctx.warn
for every orphan-targeted transaction the loader skipped. On workspaces
that have evolved through multiple model versions this produces dozens
of identical-looking warnings on every page load, drowning out real
warnings without giving operators an actionable signal.

Replace with a single coalesced ctx.info summary at the end of addTxes:
total count plus a byClass breakdown. The information needed for
diagnosing migration issues is still present, just consolidated.

Signed-off-by: Michael Uray <michaeluray@users.noreply.github.com>
@huly-github-staging

Copy link
Copy Markdown

Connected to Huly®: UBERF-16530

…orphan-tx-coalesce

Signed-off-by: Michael Uray <michaeluray@users.noreply.github.com>
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.

1 participant