syncify icon indicating copy to clipboard operation
syncify copied to clipboard

Hot Saving Pulls Template from Wrong Project

Open WolfGreyDev opened this issue 8 months ago • 0 comments

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

  1. Have an existing project (Project A) with active sy watch --hot session connected to Store A
  2. In another terminal, create a new project (Project B) with sy init connected to Store B
  3. Remove Project B's package.json
  4. Run sy projects and select Project B (this throws an error)
  5. Manually delete Project B from ~/.syncify
  6. Return to Project A and attempt to save a file (sections/test.liquid)
  7. 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

  1. Close all active watch sessions
  2. Run sy projects and select the correct project
  3. Restart watch session
  4. Make a new save of the theme.liquid
  5. 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

WolfGreyDev avatar Apr 29 '25 09:04 WolfGreyDev