Skip to content

Continue chat-session cleanup when one session fails during site delete - #4292

Merged
bcotrim merged 2 commits into
trunkfrom
per-session-cleanup-on-site-delete
Jul 22, 2026
Merged

Continue chat-session cleanup when one session fails during site delete#4292
bcotrim merged 2 commits into
trunkfrom
per-session-cleanup-on-site-delete

Conversation

@bcotrim

@bcotrim bcotrim commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Related issues

How AI was used in this PR

AI was used to implement the focused robustness change, add the regression test, and run validation.

Proposed Changes

  • Ensure deleting a site continues removing its remaining AI chat sessions when one session's metadata cleanup fails.
  • Preserve best-effort metadata cleanup when a session file is already missing.

Testing Instructions

  • Run npx eslint --fix packages/common/ai/sessions/manage.ts packages/common/ai/sessions/tests/delete-sessions-for-site.test.ts.
  • Run npm run typecheck.
  • Run npm test -- packages/common/ai/sessions/tests/delete-sessions-for-site.test.ts and confirm all three tests pass.

Pre-merge Checklist

  • Have you checked for TypeScript, React or other console errors?
@bcotrim
bcotrim marked this pull request as ready for review July 21, 2026 20:13
@bcotrim
bcotrim requested a review from sejas July 21, 2026 20:13

@sejas sejas left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Code looks good!

@bcotrim
bcotrim enabled auto-merge (squash) July 22, 2026 10:30
@wpmobilebot

Copy link
Copy Markdown
Collaborator

📊 Performance Test Results

Comparing b925f72 vs trunk

app-size

Metric trunk b925f72 Diff Change
App Size (Mac) 1361.90 MB 1361.90 MB +0.00 MB ⚪ 0.0%

site-editor

Metric trunk b925f72 Diff Change
load 1084 ms 1087 ms +3 ms ⚪ 0.0%

site-startup

Metric trunk b925f72 Diff Change
siteCreation 7001 ms 7013 ms +12 ms ⚪ 0.0%
siteStartup 2360 ms 2356 ms 4 ms ⚪ 0.0%

Results are median values from multiple test runs.

Legend: 🟢 Improvement (faster) | 🔴 Regression (slower) | ⚪ No change (<50ms diff)

@bcotrim
bcotrim merged commit e6146d8 into trunk Jul 22, 2026
13 checks passed
@bcotrim
bcotrim deleted the per-session-cleanup-on-site-delete branch July 22, 2026 11:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants