Bug 166302 - [usability][api] allow the user to save editor with a different name when read-only
Summary: [usability][api] allow the user to save editor with a different name when rea...
Status: ASSIGNED
Alias: None
Product: Target Management
Classification: Tools
Component: RSE (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 enhancement (vote)
Target Milestone: Future   Edit
Assignee: David McKnight CLA
QA Contact: Martin Oberhuber CLA
URL:
Whiteboard:
Keywords: api
Depends on: 143462 165171 197976
Blocks:
  Show dependency tree
 
Reported: 2006-11-29 21:48 EST by Michael Scharf CLA
Modified: 2012-05-22 14:58 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Scharf CLA 2006-11-29 21:48:29 EST
- open a read only file (ftp/ssh/rse-server)
- edit the file
- save it
- you get an error message (as expected)

BUT: the editor shows the new content and the remote file has the old content!
To get the real content, you have to delete the cache file.

Expected:
- don't allow the file to be edited
- or keep the buffer modified
Comment 1 Michael Scharf CLA 2006-11-29 21:49:39 EST
I tried it with: 1.0 and N20061124-0100
Comment 2 Martin Oberhuber CLA 2006-11-30 05:08:02 EST
That sounds severe! Dave can you look at it?
Comment 3 David McKnight CLA 2006-11-30 14:16:07 EST
I've changed things so that the IFile has it's read only attribute set appropriately.  When a readonly file is opened in an editor the buffer can't be modified without being prompted to change it to writable.  If the user choses to make it writeable, however, we can't prevent the edits from happening.  This at least makes the user aware.  Do you think that's enough?    
Comment 4 Michael Scharf CLA 2006-11-30 14:45:32 EST
Well' that's better than now. But if the user modifies the file a synchronize (or the failed save) should get back the original unmodified version. I think it is really bad if the files are out of sync and there no way to get the target version (except doing low level thing like deleting the cache file)....
Comment 5 David McKnight CLA 2006-11-30 15:14:26 EST
Only concern I have with that is that local user changes would be lost.  At least with the current approach, the user (who changed the local copy to writable) could later modify the host permissions and then attempt the save again.
Comment 6 Martin Oberhuber CLA 2006-12-01 05:41:49 EST
The change which makes the user aware of the read-only file looks good.

I think that in the future, we'll want the "change to writable" operation to actually change the remote file to writable. We'll need new API to cover this. This is covered in bug 165171 for now, but we might want to make a new bug entry for explicitly covering the r/w API.

The issue of potentially overriding local changes when the user re-synchronizes with the remote side is covered by bug 143462 -- when the local file cache is "dirty" and about to get updated by something new from the remote side, the user should be notified and prompted to either keep or revert the editor buffer, just as Eclipse does it when changing a file on the disk outside Eclipse.

What I don't like with the current solution is that the local file cache is deliberately out-of-sync with the remote side: it has different contents, and different file permissions than the remote side. Perhaps a better solution would involve using the File Conflict dialog: 
  * When the user tries to save the editor, RSE tries to upload
  * Upload fails because the remote file is read-only
  * RSE should display a conflict dialog, and allow the user to save with a 
    different name [or change remote file permissions outside RSE and retry]
What do you think about this?
Comment 7 David McKnight CLA 2006-12-01 10:39:16 EST
I like the idea of allowing the user to save as a different file name.  I don't know if the conflict dialog is the right thing to use because the option of overwriting the remote file is not really available - perhaps we need an additional save-as dialog.  However, I wonder if we can defer that until 2.0 - maybe with a separate defect.
Comment 8 David McKnight CLA 2006-12-04 15:30:19 EST
I'm dropping the severity of this since the read only attribute is now set properly.  I'll leave it open (but targetted for 2.0 to deal with the proposed save-as dialog. 
Comment 9 David McKnight CLA 2007-07-11 13:19:54 EDT
I'm marking this future since the save-as portion is really a feature.
Comment 10 Martin Oberhuber CLA 2010-05-27 08:24:35 EDT
Reassigning all API related to 3.3
Comment 11 Martin Oberhuber CLA 2011-05-31 17:41:43 EDT
Moving deferred 3.3 api items to 3.4
Comment 12 Martin Oberhuber CLA 2012-05-22 14:58:19 EDT
We are post API freeze.