Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 350410 - [file] File content overridden when saved from multiple editors
Summary: [file] File content overridden when saved from multiple editors
Status: RESOLVED FIXED
Alias: None
Product: Orion
Classification: ECD
Component: Server (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 critical (vote)
Target Milestone: 0.3 M1   Edit
Assignee: Szymon Brandys CLA
QA Contact:
URL:
Whiteboard: gsoc2011
Keywords:
Depends on:
Blocks: 351182
  Show dependency tree
 
Reported: 2011-06-27 04:49 EDT by Szymon Brandys CLA
Modified: 2012-01-19 11:45 EST (History)
3 users (show)

See Also:
Szymon.Brandys: review+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Szymon Brandys CLA 2011-06-27 04:49:25 EDT
Steps:
1) Create a file in the navigator
2) Open the file in two editors 
3) Modify the file content in the first editor and save, then do the same in the other editor
See that the content is silently overridden. We should notify the user, that the content was changed in the meantime and he is going to override it.
Comment 1 Piotr Janik CLA 2011-06-27 11:24:02 EDT
Proposal:
https://github.com/pjanik/orion.server/tree/bug350410
https://github.com/pjanik/orion.client/tree/bug350410

I wrote all this code and have the rights to contribute it to Eclipse under the
eclipse.org web site terms of use.
Comment 2 Szymon Brandys CLA 2011-07-04 06:28:44 EDT
Comments:
1) ETag is returned only for requests with the 'parts' attribute e.g. http://localhost:8080/file/h/TODO.txt?parts=meta. For http://localhost:8080/file/h/TODO.txt there is no ETag. Moreover it is not returned at all for the generic handler.
2) We need to change the signature of #write in fileClient.js too
3) I would consider renaming 'etag' arg in #write to metadata or args or something like this. Then we could pass more arguments to #write if necessary without changing the signature.
Comment 3 Piotr Janik CLA 2011-07-04 10:51:34 EDT
Fixed.
Comment 4 Szymon Brandys CLA 2011-07-05 08:58:11 EDT
Fixed with 921c3dbcb1db513af5a227791d62f31892c4c4ac and f736a3053fe9694d8b2e45c6c8f3620a0460dec4.
Comment 5 libing wang CLA 2011-07-14 16:37:28 EDT
The fix of this bug caused regression on compare editor addressed by bug 352165 , which was fixed.