Skip to content

fix: preserve profile entry across query reconciliation - #697

Merged
pedronauck merged 2 commits into
mainfrom
fix/nightly-restart-ci
Oct 6, 2026
Merged

pedronauck merged 2 commits into
mainfrom
fix/nightly-restart-ci

Conversation

@pedronauck

@pedronauck pedronauck commented Oct 6, 2026 •

Copy link
Copy Markdown
Member

O Nightly da release #688 falhou antes das verificações do terminal: após o restart do daemon, a reconciliação de perfis substituiu uma consulta que a rota aguardava e o CancelledError da promessa antiga levou a interface à tela de erro.

A entrada da rota agora acompanha a consulta substituta quando há cancelamento silencioso e uma leitura em andamento. Reavalia o workspace a cada tentativa e confirma sua identidade após a resposta, para que uma troca durante a reconexão não carregue trabalho do destino sob default. Continua exigindo a identidade autoritativa antes de carregar dados do perfil e propagando erros reais. O helper de restart, os cenários E2E originais, suas asserções e seus prazos permanecem inalterados.

Validação local:

  • Regressões na suíte existente com QueryClient/router reais e respostas controladas na fronteira dos adapters: a primeira reproduz a rota em erro; a segunda reproduz a tarefa sendo lida sob default após troca de workspace. Ambas falham antes das respectivas correções; 54 testes da suíte passam na revisão final.
  • make gate da revisão final: aprovado; lint sem avisos/erros, typecheck e 7.015 testes Web aprovados.
  • Build de produção via Turbo: aprovado. React Doctor: 100/100, sem problemas.
  • Replay final com daemon real e build de produção: os dois cenários originais de prompt zsh e o cenário de troca/restauração de perfis passaram (três cenários, 1,4 minuto). A primeira revisão também passou seis repetições dos cenários de zsh.

Evidência da falha: Nightly 112266831267. O trace preservado registra a barreira de erro e a stack de cancelamento do TanStack. O relatório de dependências, a auditoria de impacto, o cenário de QA e a nota de release acompanham a alteração.

Sem mudanças de contrato CLI/HTTP/UDS/native tools, hooks, configuração, SDK, schema ou dados persistidos. Workspace e perfil mantêm sua autoridade. CI do novo head ainda precisa concluir antes do squash.

Summary by CodeRabbit

  • Bug Fixes
    • App loading now waits for an active replacement profile read after a silent cancellation, preventing a router error and ensuring task-run loading uses the latest profile.
    • When the workspace changes during loading, task-run loading now uses the profile for the destination workspace.

@vercel

vercel Bot commented Oct 6, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated
compozy-site Ready Ready Preview Oct 6, 2026 1:53pm UTC

Request Review

@coderabbitai

coderabbitai Bot commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository: compozy/compozy/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: e83be77e-6a7d-4907-993c-5eab6bac0480
📥 Commits

Reviewing files that changed from the base of the PR and between fe5bb6d and ef8da58.

⛔ Files ignored due to path filters (5)
  • .release-notes/profile-entry-reconnect.md is excluded by !**/*.md
  • docs/_memory/change-impact.md is excluded by !**/*.md
  • docs/qa/reports/2026-10-05-dependency-upgrades.md is excluded by !**/*.md
  • docs/qa/scenarios/ET-profile-switcher-restore.md is excluded by !**/*.md
  • docs/qa/scenarios/ET-terminal-shell-config-fidelity.md is excluded by !**/*.md
📒 Files selected for processing (2)
  • web/src/routes/_app/-app-preload.ts
  • web/src/routes/_app/__tests__/-route-preloading.integration.test.tsx

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 6 remain after this review.


Walkthrough

Profile preloading now repeats profile selection if the profile lens changes during a fetch. It retries silent cancellation only while the query is still fetching. Integration tests cover task-run loading with replacement profiles, including after a workspace change.

Changes

Profile preload

Layer / File(s) Summary
Profile preload retry and integration test
web/src/routes/_app/-app-preload.ts, web/src/routes/_app/__tests__/-route-preloading.integration.test.tsx
prepareAppProfile repeats profile selection when the profile lens changes and retries silent cancellation only while the query remains fetching. The integration test verifies that task-run loading waits for the replacement profile, or uses the destination workspace’s profile after a workspace change.

Priority: ➖ Normal

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 2 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the fix to preserve profile entry during query reconciliation, which matches the primary change.
  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

github-actions Bot commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

React Doctor found no new issues. 🎉

Reviewed by React Doctor for commit ef8da58.

coderabbitai[bot]
coderabbitai Bot previously approved these changes Oct 6, 2026
@greptile-apps

greptile-apps Bot commented Oct 6, 2026 •

Copy link
Copy Markdown

RetriggerConfidence Score: 5/5

[Medium risk] Fixes profile loading during daemon reconnection.

The reviewed changes appear safe to merge once the required current-head CI checks are green.

Summary

The PR makes route entry follow a replacement profile-selection read after silent cancellation and rechecks workspace identity before releasing scoped loaders.

  • Extends the route-preloading regression to cover a workspace switch during reconciliation.
  • Updates the impact audit, QA evidence, and release note.
Diagram
sequenceDiagram
  participant Route
  participant Workspace
  participant Query
  Route->>Workspace: Read current profile lens
  Route->>Query: Fetch selection for lens
  Query-->>Route: Silent cancellation or selection
  alt Silent cancellation with live replacement
    Route->>Workspace: Read lens again
    Route->>Query: Follow current selection read
  else Successful selection
    Route->>Workspace: Confirm lens still matches
    Route-->>Route: Release scoped loaders
  end
Loading

Reviews (2) · Last reviewed commit: "fix: revalidate workspace identity durin..."

Comment thread web/src/routes/_app/-app-preload.ts Outdated
@pedronauck
pedronauck merged commit 418c1a1 into main Oct 6, 2026
50 checks passed
@pedronauck
pedronauck deleted the fix/nightly-restart-ci branch October 6, 2026 15:19

This branch was successfully deployed

1 active deployment
Preview — ef8da581 Deployed Oct 6, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant