[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

IStream Seek issue with Drag & Drop from TSVN repo browser

From: Leo Davidson <leonudeldavidson_at_gmail.com>
Date: Thu, 6 Apr 2017 11:08:11 +0100

Hi there,

I think there is a bug in the TSVN repo browser (and maybe anything
else that shares its drag & drop code).

This happens with TSVN 1.9.5.27581 which detects as the latest
version. I also checked the trunk changelog for related recent commits
and didn't see any.

One line summary:

- The IDataObject that TSVN provides contains an IStream which begins
positioned at the end of the data, rather than the start. So if the
drop target tries to read out of the stream, it gets a zero byte
result, as it is already at the end.

Workaround:

- The drop target can rewind the IStream before reading from it, but I
believe it is wrong to require the target to do this, and doing so in
general isn't part of the spec and may cause problems with some drop
sources.

More detail:

This does not seem to affect File Explorer, but is/was causing 0 byte
files when dragging from the TSVN repo browser to Directory Opus.

I'm one of the Opus developers, looking into this. From our side it is
no longer a problem as we have added the workaround above, which is
only triggered if we detect the drop is coming from TSVN. (That change
is not yet released but expected to be part of Opus 12.5) Things seem
to work with our program now. But I wanted to let you know in case it
causes similar problems with other software, or in case there is
something in the drag & drop spec I am not aware of which says the
drop target, not the drop source, is responsible for rewinding the
stream before reading.

My understanding is that the IStream in a drag & drop may not be
rewindable at all (e.g. if it comes from an archive where you cannot
normally seek in the data) so it seems like the drop target should not
be the one rewinding the stream. My guess is there is some code in
TSVN which writes data into the stream and forgets to then reset the
seek pointer to the start before passing the stream to another
program.

There is a little more information, and a screenshot from debugging
showing the seek position right after we get the stream out of the
data object, here:

https://resource.dopus.com/t/drag-drop-from-tortoisesvn-repo-browser-creates-zero-length-files/25461/2

If we can help with any extra detail or tests, just let me know. And
apologies if the issue turns out to be on our side after all. Drag &
drop is a complex business so it's always possible I have overlooked
something.

Leo

------------------------------------------------------
http://tortoisesvn.tigris.org/ds/viewMessage.do?dsForumId=4061&dsMessageId=3227139

To unsubscribe from this discussion, e-mail: [users-unsubscribe_at_tortoisesvn.tigris.org].
Received on 2017-04-06 12:08:30 CEST

This is an archived mail posted to the TortoiseSVN Users mailing list.