| Summary: | Content conflict dialog pops up when it should not | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | [Tools] Target Management | Reporter: | Samuel Wu <samuelwu> | ||||||
| Component: | RSE | Assignee: | David McKnight <dmcknigh> | ||||||
| Status: | RESOLVED FIXED | QA Contact: | Martin Oberhuber <mober.at+eclipse> | ||||||
| Severity: | normal | ||||||||
| Priority: | P3 | CC: | dmcknigh | ||||||
| Version: | unspecified | ||||||||
| Target Milestone: | 3.2.1 | ||||||||
| Hardware: | PC | ||||||||
| OS: | Windows XP | ||||||||
| Whiteboard: | |||||||||
| Bug Depends on: | |||||||||
| Bug Blocks: | 316798 | ||||||||
| Attachments: |
|
||||||||
|
Description
Samuel Wu
Without having a UI scenario or example code to use in order to reproduce the problem, it's difficult to speculate what you're running into. With the steps described, should I be able to reproduce this? I tried following the steps but to no avail (I'm assuming the all file attribute changes occur via RSE, as opposed to outside of Eclipse). The listed steps was how we reproduced the problem. And the file content update and file attribute change happened outside eclipse. (In reply to comment #2) > The listed steps was how we reproduced the problem. And the file content update > and file attribute change happened outside eclipse. Hmm, I've tried to reproduce this using both the HEAD stream and the latest from the RSE 3.0.x maintenance stream but so far I've been unable to reproduce the problem using the steps described. I asked a colleague to try but he couldn't reproduce it either. Is there anything that may be missing from the steps? *** Bug 314989 has been marked as a duplicate of this bug. *** That's the way we reproduced the probem. The call is an API call and run by our UI. I don't know what else happened which may have impact on RSE. (In reply to comment #5) > That's the way we reproduced the probem. The call is an API call and run by our > UI. I don't know what else happened which may have impact on RSE. I understand that you can reproduce the problem via the API call. I'm wondering if there's something missing from the steps you described for reproducing it via RSE (as opposed to your API call): > The scenario is like the following. > 1. The API is called to download the readonly file from windows local file > system to RSE cache > 2. Change the file attribute to make the file editable and make a change to the > file. > 3. Change the file attribute back to readonly. > 4. Call the API again to download the file. > There is a content conflict dialog pops up. It shouldn't since there is no > change to the cached file. Are you still able to consistently reproduce it this way? More details on the problem reproducing. Here is how our action calls the API. 1. Our action actually copy the local file and upload it to a remote host. 2. UniversalFileTransferUtility.copyRemoteResourceToWorkspace(IRemoteFile, IProgressMonitor) line: 2955 is called which calls UniversalFileTransferUtility.downloadResourceToWorkspace(IRemoteFile, IProgressMonitor) line: 1186 to create a copy of the file in the RSE cache 2. The parent folder of the file is refreshed. directory.refreshLocal(IResource.DEPTH_ONE, null); 3. Get the remote folder IRomoteFile newTargetFolder = targetFS.getRemoteFileObject(newPath, null); 4. Get all the file children of the local folder IResource[] children = directory.members(); 5. Upload the local cache to remote targetFS.upload(srcFileLocation, srcCharSet, newPath, targetFS.getRemoteEncoding(), monitor); I found it's much easier to reproduce the problem when copy/paste the parent folder of the local read only file. Hope this helps you to reproduce it. Created attachment 171670 [details]
patch to check and set properties via universal transfer utility
I have an idea of what the problem may be but I'm not sure. Samuel, could you try your scenario with this patch?
After the patch, I got the following error message RSEF1002, Operation failed. File system input or output error, Message reported from file system: File 5585.txt can not be saved on LOCALHOST. You do not have write access to the file. The file was actually pasted on the host with the updated content. Samuel, could you please post an actual testcase? An action contribution with code that reproduces the bug would be preferable since trying to guess at how to reproduce this is turning out to be a waste of time. Dave,
The problem was reproduced using the following code.
ISystemRegistry registry = RSECorePlugin.getTheSystemRegistry();
IHost localConnection = registry.getLocalHost();
IRemoteFileSubSystem ss = RemoteFileUtility.getFileSubSystem(localConnection);
IProgressMonitor monitor = new NullProgressMonitor();
String localDirPath = "D:\\temp\\5585";
try {
IRemoteFile localDir = ss.getRemoteFileObject(localDirPath, monitor);
UniversalFileTransferUtility.copyRemoteResourceToWorkspace(localDir, new NullProgressMonitor());
if (true)
return ;
}
catch (Exception e){
}
Dirctory D:\temp\5585 contain a readonly file test.txt (In reply to comment #11) > Dave, > The problem was reproduced using the following code. > > ISystemRegistry registry = RSECorePlugin.getTheSystemRegistry(); > IHost localConnection = registry.getLocalHost(); > IRemoteFileSubSystem ss = RemoteFileUtility.getFileSubSystem(localConnection); > IProgressMonitor monitor = new NullProgressMonitor(); > String localDirPath = "D:\\temp\\5585"; > try { > IRemoteFile localDir = ss.getRemoteFileObject(localDirPath, monitor); > UniversalFileTransferUtility.copyRemoteResourceToWorkspace(localDir, new > NullProgressMonitor()); > if (true) > return ; > } > catch (Exception e){ > } I tried this both with and without the patch. Without the patch, I notice that, if I change the read-only property of the file on the file system and then run the test, the property is not updated. With the patch, the property is updated. In either case, however, I don't hit a conflict dialog. With the sample code, are there steps you had to take that would reproduce the conflict? Here are my steps. 1. Run the action to download the parent directory of the readonly file 2. Change the file properties in windows explorer and update the file 3. Change the file properties back to readonly 4. Run the action again I got the conflick pops up Were you testing it on 3.2 or 3.0.3.x? I'm on 3.0.3.x (In reply to comment #14) > Here are my steps. > 1. Run the action to download the parent directory of the readonly file > 2. Change the file properties in windows explorer and update the file > 3. Change the file properties back to readonly > 4. Run the action again > I got the conflick pops up > Were you testing it on 3.2 or 3.0.3.x? I'm on 3.0.3.x I've tried this with both the 3.2 and 3.0.3.x environments and I still haven't hit a conflict dialog. When changing the file properties in Windows Explorer, I simply toggle the read-only checkbox in the properties dialog - is this what you do too? Step 2 2. Change the file properties in windows explorer and update the file You need to make a change to the file, close the file and change the file back to read only. Created attachment 171849 [details]
updated patch with marked download timestamp
I've managed to reproduce this now. I think the problem is that tempFile.getLastModified() is not always accurate and hence the SystemTempFileListener gets a different value from tempFile.getLocation().toFile().lastModified() indicating that there is a change to the temp file for upload. The patch should rectify that. Could you try it?
Thanks for the fix, Dave. Please port it back to 3.0.3. Bug 316798 is opened. I've committed the change to cvs. |