Architecture: How should VfsSyncService detect whether to load modules fro...

Documentation for Sessions

🏗️ Architecture: How should VfsSyncService detect whether to load modules fro...

Date: 2026-03-10
Time: 21:12:57 UTC
Session: gspace1-200.8
Agent: angular
Confidence: 90%
Status: ✅ Documented


📋 Decision Context

Question:

How should VfsSyncService detect whether to load modules from GitLab or local disk?

Task: S200: VfsSyncService GitLab mode detection


🎯 Decision Made

Chosen:

Mode-aware pattern with setRepoContext(spaceSlug, universeSlug, branch). Shell components call setRepoContext() once from route params before hydration. All downstream operations (hydrate, refresh, edit-sync) auto-detect mode via repoContext presence.

Options Considered:


💭 Reasoning

Two alternatives: (1) pass slugs through every method call — verbose, error-prone. (2) Global config/service — too broad, doesn't support per-project switching. The setRepoContext() pattern is clean: set once, read everywhere. The repoContext is private state that controls branching in hydrateModuleFiles(), syncChangeToBackend(), refreshAllModules(). Shell components are the natural entry point since they own route params. The fallback to disk mode when repoContext is null preserves backward compatibility.


📁 Files Involved


🔗 Related


Auto-generated by MCP Smart Consolidation