yaade icon indicating copy to clipboard operation
yaade copied to clipboard

Stuff gets constantly overwritten - Multi User

Open cmenzi opened this issue 11 months ago • 4 comments

When working with multiple users (or can also simulate it with multiple tabs) on the same collection and press "Ctrl+S" -> Collection Saves, things gets constantly overwritten.

Example:

  1. I changed a secret or variable, Ctrl+S -> Stuff saved
  2. Somebody else have opened the same collection and also press Ctrl+S -> everything gets overwritten with old data

Result: Last win -> All my changes I've made in the collection settings are gone / overwritten with the old values

This happened to me now several times, that somebody just overwritten my changes I've made to the collection.

Suggestion: If somenbody is doing a change, the UI should immediately update the changes.

cmenzi avatar Jan 08 '25 09:01 cmenzi

It's not as easy to solve as you proposed. If someone would change your variables you wouldn't even notice and suddenly you would execute different requests. Currently only on reload does the client fetch the new state from the server. I already thought about introducing "snapshots" that are fixed and you can always revert your current request or collection to that snapshot. Another solution is to introduce websockets and "lock" requests that are currently being worked on by other users, but even then you could modify environment variables via scripts.

jonrosner avatar Jan 09 '25 09:01 jonrosner

I just figured out, it's even worse. It's just by clicking around from request to request. the collection gets saves automatically.

Case Description:

2 users (ME & YOU) goes to yaade and opens the collection "A".

  • ME change some environment variable or secret and press save
  • YOU go a request and click send. -> This changes the save button to "active"
  • YOU go to another request -> This triggers the save of the collection "A", with the OLD values

cmenzi avatar Jan 09 '25 09:01 cmenzi

It's not as easy to solve as you proposed. If someone would change your variables you wouldn't even notice and suddenly you would execute different requests. Currently only on reload does the client fetch the new state from the server. I already thought about introducing "snapshots" that are fixed and you can always revert your current request or collection to that snapshot. Another solution is to introduce websockets and "lock" requests that are currently being worked on by other users, but even then you could modify environment variables via scripts.

I also see 2 options:

  1. Use optimistic locking. If a record has changed in the mean time, you can inform the user that he has to reload first
  2. Use websockets to "distributely" update all user's screens

UPDATE: Or 3. always reload the data on every page change.

UPDATE 2: Maybe, it would be already better if you would NOT do a PUT collection, when request has changed. Why is a request "changed" if I just press "send"?

cmenzi avatar Jan 09 '25 09:01 cmenzi

Why is a request "changed" if I just press "send"?

You can configure that. If you go to Options -> General you can tick this off. The reason it's on by default is that for most users this is the better way to handle things.

jonrosner avatar Jan 09 '25 11:01 jonrosner