Commit afa3a26
fix(plugin-reports)!: a non-member schedule timezone no longer discards the cron expression (#16878)
* fix(plugin-reports): a non-member schedule timezone no longer discards the cron expression
`ReportService.scheduleReport`'s eager guard used the callback-less
`new Cron(expr, { timezone })`, which validates the EXPRESSION and lets any
string through as the zone: croner defers that judgement to `nextRun()`.
`nextRunAt` then caught the deferred `CronDate` TypeError and returned
`from + interval_minutes`, so a schedule authored as "every weekday 09:00
Asia/Shanghai" fired every 1440 minutes forever, re-derived on every sweep
through `advanceSchedule` — the verbatim outcome the guard's own comment says
it exists to prevent — and the single warning it emitted named the cron
expression, which was fine, rather than the timezone, which was not.
- `scheduleReport` asks `isValueDomainMember('iana_time_zone', …)` from
`@objectstack/spec/shared` — the same predicate `sys_report_schedule.timezone`
enforces on write — so the service door and the storage door give one answer,
and the refusal names the input that is actually wrong. The row now stores the
same string the scheduler evaluates.
- On a sweep, a schedule whose stored zone is not a member and which carries a
cron expression is not run and its `next_run_at` is not advanced;
`last_status` / `last_error` (both pre-existing columns) carry the reason.
`active` and the past `next_run_at` are left alone deliberately, so correcting
the zone resumes the schedule on the next sweep with no second action.
Interval-only schedules are untouched — interval arithmetic never reads the
zone.
- Both fall-back warnings now name the expression AND the zone, and the second
no longer asserts the expression is the broken half.
Fixes #16291
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012zTkyNHJ7TkuN2oXtP5x37
* chore(changeset): grade #16291 minor and declare it breaking, with its ADR-0087 disposition
The level was patch. Re-derived on two axes, and the second is what moves it.
AXIS 1 -- accept-set narrowing -- DOES NOT HOLD, measured. `scheduleReport`
refusing a non-member timezone looked like a narrowing of a published API, but
the storage door already refuses the same value: on a real ObjectKernel with a
real SqlDriver, `insert` into `sys_report_schedule` with
`timezone: 'Mars/Olympus'` answers
`VALIDATION_FAILED · Timezone must be a valid IANA time zone identifier`
on origin/main today. No reachable accept set narrows; the refusal only moves
to an earlier door with a clearer message, which is what the card asked for.
AXIS 2 -- withdrawal of running behaviour -- DOES hold, and decides it. A row
stored before `valueDomain: 'iana_time_zone'` landed, carrying a cron and a
non-member zone, is delivering today on the interval cadence and delivers
nothing after this change until a human corrects the row. The upgrade requires
operator action on stored data to restore a delivery that is happening now, and
nothing restores it automatically. During the launch window the level carries no
breaking-ness at all -- the BREAKING banner and the ADR-0087 disposition are the
only channels -- so a patch with neither would tell that operator there is
nothing to look at.
Level minor rather than major: `check-changeset-no-major` refuses major during
the window. 226 minor changesets are already pending, so grading this honestly
moves no release.
Disposition is `not-required (no-migration-prescription)`: no metadata key, def
or shape moves, so the migration chain has nothing to rewrite. The obligation is
data-side -- `last_status` on the row the operator is already looking at.
No behaviour was changed to fit the level.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012zTkyNHJ7TkuN2oXtP5x37
* chore(changeset): add the conventional-commits bang to the breaking declaration
`breakingDeclaration` reads three independent signals and the union is what
CI records; the banner alone already declared it. The bang is added so the
summary line carries the declaration too, matching the other declared-breaking
changesets in stock.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012zTkyNHJ7TkuN2oXtP5x37
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent 142c01c commit afa3a26
5 files changed
Lines changed: 387 additions & 16 deletions
File tree
- .changeset
- packages
- platform-objects/src/audit
- plugins/plugin-reports
- src
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
Lines changed: 12 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
98 | 98 | | |
99 | 99 | | |
100 | 100 | | |
101 | | - | |
102 | | - | |
103 | | - | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
104 | 113 | | |
105 | 114 | | |
106 | 115 | | |
| |||
Lines changed: 191 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
465 | 465 | | |
466 | 466 | | |
467 | 467 | | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
| 584 | + | |
| 585 | + | |
| 586 | + | |
| 587 | + | |
| 588 | + | |
| 589 | + | |
| 590 | + | |
| 591 | + | |
| 592 | + | |
| 593 | + | |
| 594 | + | |
| 595 | + | |
| 596 | + | |
| 597 | + | |
| 598 | + | |
| 599 | + | |
| 600 | + | |
| 601 | + | |
| 602 | + | |
| 603 | + | |
| 604 | + | |
| 605 | + | |
| 606 | + | |
| 607 | + | |
| 608 | + | |
| 609 | + | |
| 610 | + | |
| 611 | + | |
| 612 | + | |
| 613 | + | |
| 614 | + | |
| 615 | + | |
| 616 | + | |
| 617 | + | |
| 618 | + | |
| 619 | + | |
| 620 | + | |
| 621 | + | |
| 622 | + | |
| 623 | + | |
| 624 | + | |
| 625 | + | |
| 626 | + | |
| 627 | + | |
| 628 | + | |
| 629 | + | |
| 630 | + | |
| 631 | + | |
| 632 | + | |
| 633 | + | |
| 634 | + | |
| 635 | + | |
| 636 | + | |
| 637 | + | |
| 638 | + | |
| 639 | + | |
| 640 | + | |
| 641 | + | |
| 642 | + | |
| 643 | + | |
| 644 | + | |
| 645 | + | |
| 646 | + | |
| 647 | + | |
| 648 | + | |
| 649 | + | |
| 650 | + | |
| 651 | + | |
| 652 | + | |
| 653 | + | |
| 654 | + | |
| 655 | + | |
| 656 | + | |
| 657 | + | |
| 658 | + | |
468 | 659 | | |
469 | 660 | | |
470 | 661 | | |
| |||
0 commit comments