Commit 2d97224
authored
ENG-1490 Fix ZodError in getAllDiscourseNodes for legacy block prop shapes (#856)
* ENG-1490 Fix ZodError in getAllDiscourseNodes for legacy block prop shapes
Migrate legacy discourse node block props on read instead of dropping
nodes that fail schema validation. Handles two known shape changes:
- specification: Condition[] → {enabled, query: {conditions, ...}}
- suggestiveRules.isFirstChild: {uid, value} → boolean
On successful migration, writes the fixed data back so subsequent reads
hit the happy path. Nodes that can't be migrated still report to PostHog.
* ENG-1490 Report post-migration error instead of pre-migration error
When migration fails, report retryResult.error (remaining issues) instead
of result.error (original issues) so PostHog shows actionable diagnostics.
* ENG-1490 Use correct returnNode default in migration
Set returnNode to "node" (matching DEFAULT_RETURN_NODE and IndexSchema
default) instead of "" which bypasses Zod's .default() and would persist
incorrect empty values for migrated nodes.1 parent 902ee22 commit 2d97224
1 file changed
Lines changed: 79 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
493 | 493 | | |
494 | 494 | | |
495 | 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 | + | |
496 | 557 | | |
497 | 558 | | |
498 | 559 | | |
| |||
517 | 578 | | |
518 | 579 | | |
519 | 580 | | |
| 581 | + | |
520 | 582 | | |
521 | 583 | | |
522 | | - | |
523 | | - | |
524 | | - | |
525 | | - | |
526 | | - | |
| 584 | + | |
527 | 585 | | |
528 | | - | |
529 | | - | |
530 | | - | |
531 | | - | |
532 | | - | |
533 | | - | |
| 586 | + | |
| 587 | + | |
| 588 | + | |
| 589 | + | |
| 590 | + | |
| 591 | + | |
| 592 | + | |
| 593 | + | |
| 594 | + | |
| 595 | + | |
| 596 | + | |
| 597 | + | |
| 598 | + | |
| 599 | + | |
| 600 | + | |
| 601 | + | |
534 | 602 | | |
535 | 603 | | |
536 | 604 | | |
| |||
0 commit comments