Bugfix: Why did the entire Vitto Studio live preview pipeline silent...

Documentation for Sessions

πŸ› Bugfix: Why did the entire Vitto Studio live preview pipeline silent...

Date: 2026-03-18
Time: 00:00:23 UTC
Session: gspace1-231.6
Agent: backend
Confidence: 98%
Status: βœ… Documented


πŸ“‹ Decision Context

Question:

Why did the entire Vitto Studio live preview pipeline silently fail β€” showing 'Ready when you are' even with 5 modules generated?

Task: Fix Vitto Studio live preview showing 'Ready when you are' with generated modules


🎯 Decision Made

Chosen:

Three-layer fix: (1) forkJoin to emit modulesLoaded$ after ALL file contents fetched, (2) correct GitLab type mapping blob→file in listFilesRecursive, (3) clear loadedModuleSlugs on VFS re-init. Root cause was the type mapping: GitLab returns type:'blob', code checked type==='file', so every file was misidentified as directory. Zero files ever entered VFS.

Options Considered:

  1. Fix only the timing (forkJoin) β€” would not have worked alone
  2. Fix only the type mapping β€” would have worked but timing race remained
  3. Fix all three layers (chosen) β€” addresses root cause + timing + caching

πŸ’­ Reasoning

The failure was invisible because every layer had catchError() swallowing exceptions silently. The type mapping chain crossed 3 services (gitlab-provider → git-provider.controller → studio-repo.controller → flattenFileNodes) with each layer transforming types and none validating the output. The blob→file mapping was a TypeScript cast ('as file') that didn't transform the actual runtime value. This is a class of bug where TypeScript's type system gives false safety — the cast makes the compiler happy but the runtime value is still 'blob'. The forkJoin fix was necessary but insufficient alone because the timer(1500) workaround was masking the real type-mapping bug. Early warning: any time you see a type cast on API response data, verify the runtime value matches the expected domain type.


πŸ“ Files Involved


πŸ”— Related


Auto-generated by MCP Smart Consolidation