Bugs » #13
This section on the Community is no longer supported, in favour of Wikidot's Official Feedback Site.
It is retained here for archiving purposes.
Bugs
Tags
Posted by Phil Chett on 07 Jun 2008 10:47, last edited on 04 Mar 2009 09:35
This bug is open |
Description
Simply put, when uploading a file to replace a pre-existing one of the same name, in most cases the file is not overwritten.
This is a cache issue in the Wikidot engine. Files are first uploaded to the Wikidot file server, and when first accessed/viewed, they are copied to the Wikidot cache, and accessed from there.
When files are deleted, they are removed from the Wikidot file server, and then removed from the Wikidot cache at a later date. This means that whilst you have deleted a file from the server, it can potentially continue to be accessed.
Similarly, this is also the case when files are overwritten. Files are overwritten on the Wikidot server, but are not removed from the Wikidot cache. So when you overwrite a file and go to access it, the old version of the file will be accessed instead of the new one.
Files are only transfered to the Wikidot cache the first time they are accessed. So if you upload a file and delete or overwrite it before it is first accessed, then the new/updated file will be transfered to the Wikidot cache, and no problems will arise.
If files were deleted from the cache as soon as they are overwritten, renamed or deleted from the Wikidot file server, this problem would cease to exist.
First reported by hessb in this post
How to reproduce
There are two ways to reproduce this error.
The first way involves deleting the file:
- Upload a file with a given name (i.e. test.txt);
- Open/View the uploaded file;
- Delete it;
- Upload a different file with the same given name;
- Open/View the new uploaded file.
The second way involves overwriting the file:
- Upload a file with a given name (i.e. test.txt);
- Open/View the uploaded file;
- Upload a different file with the same given name;
- Click "overwrite" on the message box that pops up (it is asking you if you want to overwrite an existing file);
- Open/View the new uploaded file.
On opening the file for a second time, the first version is displayed, NOT the second one
Browsers
All
Workarounds?
None — you must give the new file a new name.
Rate this Bug
Rate the urgency of this bug. If you think it is more urgent and important than it's current rating suggests, rate it up.
I have a workaround, although, inconvenient, it works.
If you want to upload a file to replace a previously existing one, follow these instructions:
How it works? I believe that when a file is renamed, it is simply copied with a new name, but the Wikidot engine 'forgets' to delete the existing file. I also believe that when you delete a file permanently, that the Wikidot engine puts that file in the que for permanent deletion, and so it is yet to be deleted. Until it is deleted, you can not upload files of the same name on that particular page.
When you move a file to a different page, Wikidot doesn't go through the whole "copy" process; it simply and literally "moves" the file to a different page. Thus, the original page no longer has the file, or any reminiscence of it, and you can upload files to replace the pre-existing one — without any interference or problems.
Cheers ~ James Kanjo
This technique no longer works for some strange reason (I used to do it all the time).
Hey, this could be basically a cache issue. Try to do the following:
a) upload file
b) DON'T view the uploaded file (not trigger caching yet)
c) upload a different file under the same name
d) try to view the uploaded file
If you get the NEW content (from c) ), it's cache issue (and we have some nice idea here), if not, this really is a bug.
Piotr Gabryjeluk
visit my blog
Since a lot of people are lazy, and you came up with the idea, why don't you test it?
I have run into this before. it is definitely a cache issue. I have a document repository on my wiki at work and I run into this regularly when uploading an updated document to replace an older version. My users have to clear their cache before accessing the updated file if they had recently accessed the older file.
-Ed
Community Admin
We get round this by stating in our wiki instructions that new versions of a document are never saved with the same name but that the date and initials should appended to the file name and the new version saved and linked to on the page. This allows you to see previous versions and the build up of the document over time which is in the spirit of wikis.
Overall though I try to encourage my users not to use files where possible but to write/change the text directly into the editor. Only when we are near completion and are looking at layout of text, tables and images is it copied into Word.
Rob
Rob Elliott - Strathpeffer, Scotland - Wikidot first line support & community admin team.
Since it's been a month and nobody has done the test, I did it.
I performed TWO tests, the first one being Gabrys one:
1) Uploaded a file;
2) DIDN'T view the uploaded file (not trigger caching yet);
3) Uploaded a different file under the same name. I got a popup message asking me to overwrite and I selected 'yes';
4) Tried to view the uploaded file.
The result from this test was that I got the new file that had overwritten the old one.
Just to make sure, I performed a second test (typically the 'control' test):
1) Uploaded a file;
2) DID view the uploaded file (trigger caching);
3) Uploaded a different file under the same name. I got a popup message asking me to overwrite and I selected 'yes';
4) Tried to view the uploaded file.
The result from this test was that I got the old file that the new file had supposedly 'overwritten', and obviously has not been.
So, now we have confirmation: THIS IS DEFINITELY A CACHE ISSUE
Cheers ~ James Kanjo