-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Closed
Labels
Description
Scenario:
- Solution with 2 independent projects: A, B.
- Launch both projects.
- Make change in project A that's a valid update.
- Make change in project B that's a rude edit
We block both updates due to the rude edit. Both A and B have to be restarted, otherwise we would get to an inconsistent state.
Similarly, if B has no-effect edit (instead of a rude edit) and the project is configured to be restarted on no-effect edits. We would need to restart both A and B.
New protocol for the host:
- Call
GetUpdatesAsync - If any projects listed in
ProjectsToRestartreturned from [1] do not allow auto-restart (HotReloadAutoRestart property) and the user previously did not opted into always auto-restarting, show the rude edit dialog. If user chooses to not restart, bail and callDiscardUpdatesAsync. - Try to apply all updates returned by
GetUpdatesAsync. If this fails, callDiscardUpdatesAsyncand bail. Do not attempt to restart any projects. - Call
CommitUpdatesAsync(). - Proceed with restarting projects:
a) Terminate all processes associated with projects inProjectsToRestartset.
b) Rebuild all projects listed inProjectsToRebuild. If build fails (e.g. compilation error) ask user to fix them. If the user tries to continue run build of these projects again. Only allow EnC/Hot Reload session to continue if the build succeeds.
c) Re-launch all projects listed inProjectsToRestart.
UPDATE to account for deployment:
- Call
GetUpdatesAsync - If any projects listed in
ProjectsToRestartreturned from [1] do not allow auto-restart (HotReloadAutoRestart property) and the user previously did not opted into always auto-restarting, show the rude edit dialog. If user chooses to not restart, bail and callDiscardUpdatesAsync. - Call
CommitUpdatesAsync(). - Terminate all processes associated with projects in
ProjectsToRestartset. - Rebuild all projects listed in
ProjectsToRebuild. If build fails (e.g. compilation error) ask user to fix them. If the user tries to continue attempt building these projects again. Only allow EnC/Hot Reload session to continue if the build succeeds. - Deploy dependencies of projects listed in
ProjectsToRedeploy. - Apply all updates returned by
GetUpdatesAsync. If this operation fails in any process, the process is in a potentially corrupt state and can accept no further updates. - Re-launch all projects listed in
ProjectsToRestart.
DustinCampbell