When switching between projects while a hot reload session is active, subsequent saves pull templates from the wrong project. The hot reload functionality appears to reference the project selected via sy projects rather than maintaining connection to the project where the watch session was initiated.
Steps to Reproduce
- Have an existing project (Project A) with active
sy watch --hot session connected to Store A
- In another terminal, create a new project (Project B) with
sy init connected to Store B
- Remove Project B's package.json
- Run
sy projects and select Project B (this throws an error)
- Manually delete Project B from
~/.syncify
- Return to Project A and attempt to save a file (sections/test.liquid)
- Observe that hot reload pulls template from another project instead of Project A
Expected Behavior
- Hot reload should always reference templates from the project where the watch session was initiated
- Selecting projects via
sy projects shouldn't affect active watch sessions
Actual Behavior
- Active watch sessions appear to reference whatever project is currently selected via
sy projects
- This causes templates to be pulled from the wrong project after project selection
- Requires hard refresh, project re-selection and new file save to correct
Workaround
- Close all active watch sessions
- Run
sy projects and select the correct project
- Restart watch session
- Make a new save of the theme.liquid
- Hard refresh browser preview windows
Additional Notes
sy project throws errors for some projects and unexpectedly crashes without reason. Though the function still "switches" the project
- According to the docs,
sy projects should only return information about a project, however, there is clearly some functionality that changes Syncify's environment behind the scenes
When switching between projects while a hot reload session is active, subsequent saves pull templates from the wrong project. The hot reload functionality appears to reference the project selected via
sy projectsrather than maintaining connection to the project where the watch session was initiated.Steps to Reproduce
sy watch --hotsession connected to Store Asy initconnected to Store Bsy projectsand select Project B (this throws an error)~/.syncifyExpected Behavior
sy projectsshouldn't affect active watch sessionsActual Behavior
sy projectsWorkaround
sy projectsand select the correct projectAdditional Notes
sy projectthrows errors for some projects and unexpectedly crashes without reason. Though the function still "switches" the projectsy projectsshould only return information about a project, however, there is clearly some functionality that changes Syncify's environment behind the scenes