Some way to prevent edits to the same ESPHome YAML from different tabs/clients #3456
Replies: 4 comments 4 replies
-
|
I also am one of those chaotic ones :) , i used to do this on purpose, opening 2 windows with the same yaml, one where i actualy edit and one to scroll around because i dit not remember the id or something that i need to look up. And often this ends up in saving the wrong one. But eliminating the possibility to open 2 windows with the same yaml is also not the best solution. Automatic Instant synchronising the open windows would do the trick. but i also have no idea how to solve this inconvienience. |
Beta Was this translation helpful? Give feedback.
-
|
My workaround if i am working on a large esphome project is saving the yaml to a non existing esphome device after a succesfull improvement for viewing only purpose. It offers me a 1 step behind backup, but be sure to erase the esphome: api ota: lines on saving your non existing esphome device otherwise things get really mental if you have 2 esphome devices with the same esphome: api ota: lines. Things that frustrate me the most is that editing in Esphome builder is that there is no backup, no "make undone" button, if you change or delete something it is goooone forever. i wonder if there are othet editing sollutions for esphome. |
Beta Was this translation helpful? Give feedback.
-
|
I checked the code and it seems relatively straightforward. I'll try and see if I can get something working and open a PR for this some time next week. |
Beta Was this translation helpful? Give feedback.
-
|
Opened PRs for this here: esphome/esphome#12708 and esphome/dashboard#847 - I hope it is useful in this state and can get merged or at least receives some actionable feedback 🤞 |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Describe the enhancement
I often have too many tabs open, get distracted by real life or have other focus issues so it's happened several times now that I was editing an ESPHome YAML config in one tab, and then later on do some other changes to the same device YAML in another tab, which then doesn't match the edits from the first tab (so basically you have 2 diverged sources at that point which you need to hopefully notice yourself before you close the tabs so you can manually try to merge). This is obviously also a "me" issue but some way to either warn the user ("looks like another client is already editing this") or prevent the edit ("locked from another session") or even a live "sync" that both editors remain in sync regardless would be appreciated.
Use cases
Prevent chaotic workflows from losing YAML edits to devices
Visual examples
No response
Anything else?
I've seen this implemented in several other web applications for edits to a resource where there is some locking mechanism to prevent conflicts. The client re-locks the resource every X minutes with a timeout of X+1 minutes, making sure that long edit sessions keep the lock but also that the lock does not get "stuck" because the client didn't cleanly unlock (which could be sent when closing the editor).
Beta Was this translation helpful? Give feedback.
All reactions