Repository navigation
fix: Explain that hot reload cannot patch a Multiplayer Play Mode Virtual Player - #3191
Conversation
Hot reload tells a Multiplayer Play Mode Virtual Player to compile first when it cannot find the player's compiled assembly, but a player has no compiled assemblies under its own root, so compiling never changes the answer. These tests pin the recognizer and the reason worded for a player. The helper is a stub that keeps today's behavior, so the Virtual Player cases fail until it is implemented.
When the compiled assembly is missing and the project root is a Multiplayer Play Mode Virtual Player (<main project>/Library/VP/<player>), the (file) reason now says the player loads the main Editor's script assemblies, so hot reload cannot patch it yet, the edit reaches it through a compile, and a patch applied to the main Editor does not reach it. "Compile the project first" never helps there, because a player has no compiled assemblies under its own root. The player is recognized from the path alone, so projects without Multiplayer Play Mode still compile. Every other project keeps the existing text.
The Multiplayer Play Mode reference gains a Hot reload section: a patch stays in the Editor process it was applied to, so a patch on the main Editor never reaches a Virtual Player, and a player sent hot-reload reports the file as Failed before the CLI's compile fallback brings the edit in. The hot-reload scope reference lists the Virtual Player as a Failed condition. The generated skill copies are regenerated from the sources.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
⛔ Files ignored due to path filters (2)
📒 Files selected for processing (9)
Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 0 remain after this review. 📝 WalkthroughWalkthroughHot-reload target handling now identifies Multiplayer Play Mode Virtual Player roots and provides a specific missing-assembly message. Tests cover root detection and message content. Reference documentation describes process-local patches and the player-side compile fallback. ChangesVirtual Player hot-reload support
Priority: ⬇️ Low Estimated code review effort: 2 (Simple) | ~10 minutes Change: Bug fix Merge Risk: ⚪ Minimal · up to This change improves the hot-reload failure message for Multiplayer Play Mode Virtual Players and leaves other projects' behavior unchanged. No merge-blocking risk was found. The author did not check the behavior against a live Virtual Player. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
Trimming such a root leaves an empty string, and Path.GetDirectoryName rejects that with ArgumentException in Unity's Mono. The check runs while the missing-assembly reason is being built, so throwing there would end the run instead of reporting the file as Failed. The too-short-path test now covers a separator-only root as well.
The two new doc sentences said the CLI always compiles in the player after hot reload fails the file. The fallback follows --compile-on-skip like any unapplied edit: auto holds the compile while that player is in Play Mode (CompileFallback is HeldForPlayMode), and off never runs it, so in those cases the edit has not reached the player. The generated skill copies are regenerated from the sources.
8bd459d
into
feature/hot-reload-large-project-feedback
Summary
Failedreason now says the Editor is a Virtual Player, hot reload cannot patch it yet, the edit reaches the player through a compile, and a patch applied to the main Editor does not reach it.User Impact
uloop --project-path <PROJECT_ROOT>/Library/VP/mppm<id> hot-reload --files ...reported the file asFailedwith "Compiled assembly not found at '.../Library/ScriptAssemblies/.dll'. Compile the project first." Compiling and retrying gave the same answer.What a large-project trial observed. This project has no Multiplayer Play Mode scenario, so these were not reproduced here:
hot-reload --statuskeepsActivePatchTotalat 0.Library/ScriptAssembliesunder its own project root, because it loads the main project's. Hot reload looks for the compiled assembly under the Editor's own project root, so it cannot find it.OutcomeisReplacedByCompile).--compile-on-skip, as for any unapplied edit.auto, the default, holds it while that player is in Play Mode (CompileFallbackisHeldForPlayMode), andoffnever runs it. The docs state this condition.Changes
<main project>/Library/VP/<player directory>) from the path string alone. It does not check directories and does not reference the Multiplayer Play Mode package, so projects without that package still compile.Hot reloadsection in the Multiplayer Play Mode reference.Failedtable of the hot-reload scope reference.Not changed
Review by eye
HotReloadPatchTargetSupport.ResolvePatchTargetnow callsHotReloadVirtualPlayerProject.DescribeMissingCompiledAssembly(projectRoot, home.DllPath). No test can pin this line, becauseApplication.dataPathcannot be substituted.Verification
CI for this PR runs only the Complexity Report, File Length Report, and Dead Code Gate checks, because the PR targets the integration branch. Everything below was run locally.
uloop compile: 0 errors, 0 warnings.HotReloadVirtualPlayerProjectTests(10 tests, new):VPname check failed onlyParentIsNotVP.Libraryname check failed onlyGrandparentIsNotLibrary.TrailingSeparator.PathTooShortToHaveAGrandparentfailed withArgumentException: Invalid path. It passes with the guard.HotReloadVirtualPlayerProjectTestsHotReloadPatchTargetSupportEditorReadTests,HotReloadNewSourceMembershipTests, andHotReloadAssemblyResolutionDiagnosticsTests, which call the resolver directlyscripts/sync-tool-docs.sh --check: no drift.check-skill-size: passes.cmp).check-code-complexity.sh, set to fail when a limit is exceeded: 0 issues.check-file-length.sh, set to fail when a limit is exceeded: no file over the limit.