Repository navigation
Commit e15a732
fix(organizations): warn when a per-org seed replay refuses rows (#38629)
<!-- claude-projects-attribution: {"github_login":"os-steve"} -->
_Requested by **Steve** · [project
thread](https://claude.ai/code/project/chan_01FdL1XeUyvVNxLreh3F4Qi9?thread=cmsg_01FdL1XeUyvVNxLreh3F4Qi9St4eUWHFcCKuRUrCZPperJ)_
Fixes #35086
Clause-②: no
Metadata-protocol: none
## 维护者速读
- 用户可见变化:新建组织时若种子数据被拒收,服务器日志会以警告(而非普通信息)提示,运维能看到组织为何是空的。
- 为什么做:修复"新组织缺少标准价目表却无任何告警"的静默不完整问题。
- 出错会怎样:只改日志级别,可直接撤回,不影响数据。
- 要你做什么:无。
## What changes
`replayOrganizationSeed` in the organizations plugin now logs a per-org
seed replay with `N > 0` errors at **warn** instead of info. The warn
line keeps the stable `[org-scoping] per-org seed replay for ORG_ID:
...` prefix and appends the first error's object and message; the
context carries `organizationId` and the first five errors. A replay
with zero errors still logs the unchanged info line. Decision: an error
replay logs warn INSTEAD of info (one line per event, no duplicate);
every existing pin asserts the info line only on error-free replays, so
all stay true.
## Tests
- New pin in `organizations-plugin.test.ts`: a replay returning one
refused row raises exactly one warn naming the org, `1 error(s)`, the
object and the message, and no info line.
- `vitest run` on organizations-plugin.test.ts,
first-organization-orphan-rows.pin.test.ts,
org-creation-no-cross-org-copy.test.ts: 3 files / 34 tests passed;
`@objectstack/organizations` typecheck green (lock VERDICT command-exit
0, after building the `^...` closure).
## Acceptance notes
- Changeset: `.changeset/35086-seed-replay-warn.md` (patch).
- Local gates: only the package tests and typecheck above; the farm of
`check:*` gates is left to CI.
## Verification
Run the new test: `pnpm --filter @objectstack/organizations exec vitest
run src/organizations-plugin.test.ts` and expect it green.
🤖 Generated with [Claude Code](https://claude.ai/code)
https://claude.ai/code/session_01ADHkmRar3Kkg6SpwVgaaVE
<!-- signed: repo:objectstack#3 · os-steve ·
session_01ADHkmRar3Kkg6SpwVgaaVE -->
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent 681fec2 commit e15a732
3 files changed
Lines changed: 49 additions & 7 deletions
File tree
- .changeset
- packages/plugins/organizations/src
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
314 | 314 | | |
315 | 315 | | |
316 | 316 | | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
317 | 344 | | |
318 | 345 | | |
319 | 346 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
517 | 517 | | |
518 | 518 | | |
519 | 519 | | |
520 | | - | |
521 | | - | |
522 | | - | |
523 | | - | |
524 | | - | |
525 | | - | |
526 | | - | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
527 | 534 | | |
528 | 535 | | |
529 | 536 | | |
| |||
0 commit comments