Skip to content

chore(deps): upgrade @objectstack 7.4.1 → 7.7.0 (+ 7.6/7.7 migration)#366

Merged
xuyushun441-sys merged 4 commits into
mainfrom
chore/upgrade-objectstack-7.7
Jun 3, 2026
Merged

chore(deps): upgrade @objectstack 7.4.1 → 7.7.0 (+ 7.6/7.7 migration)#366
xuyushun441-sys merged 4 commits into
mainfrom
chore/upgrade-objectstack-7.7

Conversation

@xuyushun441-sys
Copy link
Copy Markdown
Contributor

Summary

Upgrades @objectstack/* from 7.4.1 → 7.7.0 (via 7.6), resolves every breaking change across both releases, and verifies the platform behaves end-to-end. Closes #365.

7.7 also ships the fixes for the three platform issues filed from this app during the upgrade — all re-tested and confirmed resolved:

Breaking changes handled

7.6 (ADR-0032):

  • type:'unique' validation removed → unique indexes (account.name, contact.email).
  • Build validator now schema-aware: fixed crm_campaign_member validation referencing nonexistent fields (record.lead/contactrecord.crm_lead/crm_contact).
  • Flow conditions are bare CEL (no {…} braces).

7.7 (object schema):

  • workflows[] removed from object schemas → field-update rules folded into the existing *.hook.ts before-hooks (account last_activity_date; case is_closed/closed_date/resolution_time_hours; opportunity forecast_category; task is_completed/is_overdue).
  • Scheduled / notification workflows migrated to flows: campaign-completion, quote-expiration, contract-expiration (scheduled); contact-welcome, opportunity-won-alert, task-urgent-alert (record_change). Already-covered ones (lead high-score, case critical) were not duplicated.
  • Top-level trackHistoryenable.trackHistory; shareModel:'controlled-by-parent' dropped (master-detail children inherit master sharing); top-level stateMachinestype:'state_machine' validation rule (lead status, opportunity stage), *.state.ts deleted.

Bug fixed (surfaced by testing)

Notify nodes used severity:'high', which is not a valid sys_notification.severity (info|warning|critical) — the notification insert silently failed, so alerts were never created even though the flow fired. Fixed across 6 flows (4 pre-existing + 2 new) to valid values.

Verification

  • tsc --noEmit + objectstack build green (16 flows / 15 objects).
  • Browser + API (real better-auth session) on a fresh DB:
    • record-change flows fire: lead_assignment stamps next_followup_date; opportunity_approval → pending + suspended approval run; case_escalation escalates; case_csat_followup suspends on wait.
    • unique index rejects duplicate account name (409 + UI banner).
    • migrated hook field-updates all correct (task/case/opportunity/account).
    • new notification flows create notifications (contact_welcome, urgent_task, large_deal_won), 0 insert failures.
    • audit writes persist; logger override honored.

🤖 Generated with Claude Code

os-zhuang and others added 4 commits June 3, 2026 10:17
Bumps all @objectstack/* packages to 7.7.0 (latest), via 7.6 → 7.7.

7.7 ships the fixes for the three platform issues filed during this
upgrade (all verified resolved end-to-end):
- framework#1532 — sys_audit_log "no column named organization_id"
  (audit writes now persist instead of failing on every mutation)
- framework#1533 — CLI hardcoded `logger:{level:'silent'}`
  (now honors OS_LOG_LEVEL / LOG_LEVEL / --log-level)
- framework#1534 — strict CEL on string-serialized numeric fields
  (rating/currency now hydrate; bare `record.x` comparisons work)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
7.6 (ADR-0032):
- Replace the removed `type:'unique'` validation with unique indexes
  (account.name, contact.email).
- Fix crm_campaign_member validation referencing nonexistent fields
  (record.lead/contact → record.crm_lead/crm_contact) — surfaced by the
  new schema-aware build validator.

7.7 (object-schema breaking changes):
- Remove `workflows[]` (no longer a valid object key). Field-update rules
  migrated into existing *.hook.ts before-hooks:
    account     → last_activity_date on owner/type change
    case        → is_closed / closed_date / resolution_time_hours
    opportunity → forecast_category by stage
    task        → is_completed / is_overdue
- Move top-level `trackHistory` under `enable` (campaign_member, line items).
- Drop `shareModel:'controlled-by-parent'` (sharingModel enum dropped it;
  master-detail children inherit the master's sharing).
- Replace top-level `stateMachines` with a `type:'state_machine'`
  validation rule (lead status, opportunity stage); delete the now-unused
  lead.state.ts / opportunity.state.ts XState configs.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…y severity

Migrate the scheduled/notification object workflows[] (removed in 7.7) to
first-class flows:
- scheduled:    campaign-completion, quote-expiration, contract-expiration
- record_change notify: contact-welcome, opportunity-won-alert,
                        task-urgent-alert
(lead high-score and case critical/escalation notifications were already
covered by lead_assignment / case_escalation and are not duplicated.)

Also in this round:
- Conditions are bare CEL (`record.rating >= 4`, `record.amount > 100000`).
  These are validated as CEL at build time, and the 7.7 numeric-hydration
  fix (framework#1534) makes the string-serialized rating/currency fields
  compare correctly at runtime — no `double()` cast needed.
- case_escalation: also set `escalation_reason` when flipping
  `is_escalated` true, or the object's `escalation_reason_required`
  validation rejects the write and the flow aborts.
- Fix invalid notify `severity:'high'` across 6 flows → valid
  `sys_notification` enum (info|warning|critical). 'high' silently failed
  the notification insert, so the alert was never created even though the
  flow fired.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Adds .claude/launch.json with a `crm-app` entry (objectstack dev, :4001)
so the CRM Console (/_console/) can be launched as the preview server.
(settings.local.json is intentionally left untracked — machine-local.)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@vercel
Copy link
Copy Markdown

vercel Bot commented Jun 3, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
hotcrm Ignored Ignored Jun 3, 2026 2:21am

Request Review

@xuyushun441-sys xuyushun441-sys merged commit 814ff84 into main Jun 3, 2026
5 of 7 checks passed
@xuyushun441-sys xuyushun441-sys deleted the chore/upgrade-objectstack-7.7 branch June 3, 2026 02:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Upgrade to @objectstack 7.6 and verify record-change flows fire (ADR-0032 / #1491)

2 participants