Bugs
distler Moderator 123 posts |
If you’ve found a mistake in the |
jl345
6 posts
edited 12 years ago |
--- instiki-0.19.4/lib/tasks/fixtures.rake.orig Sat Jun 30 19:40:02 2012 +++ instiki-0.19.4/lib/tasks/fixtures.rake Wed Jul 18 01:33:06 2012 @@ -74,7 +74,7 @@ task :import_all => :environment do ActiveRecord::Base.establish_connection Dir.glob(Rails.root.join('dump','fixtures',"*.yml")).each do |f| - table_name = f.gsub( Regexp.escape(Rails.root.join('dump','fixtures').to_s + File::SEPARATOR), '').gsub('.yml', '') + table_name = f.gsub( Rails.root.join('dump','fixtures').to_s + File::Separator, '').gsub('.yml', '') puts "Importing #{table_name}" import_table_fixture(table_name) end That’s what I have anyways, but be careful, because somehow I got |
distler Moderator 123 posts |
Hmmm. Both look wrong. What I think we want is:
The point being that the output of |
jl345 6 posts |
I tried a little test case… $ cat subtest.rb #!/usr/bin/env ruby puts '/some/other/string'.gsub( '/some/other' + File::SEPARATOR, '' ) puts '/some/other/string'.gsub( Regexp.escape( '/some/other' + File::SEPARATOR), '' ) puts '/some/other/string'.gsub( Regexp.new( Regexp.escape( '/some/other' + File::SEPARATOR ) ), '' ) $ ./subtest.rb string string string $ ruby --version ruby 1.8.7 (2012-06-29 patchlevel 370) [x86_64-openbsd] I believe that my first and third examples are both correct and equivalent, going by official docs. The second example works, too, in this case, because a forward slash is apparently not one of the characters escaped by |
Andrew Stacey 118 posts |
I’m unable to run the inbuilt SVG editor on my computer (running Mac OS X, Lion). The window launches but none of the icons are present and although the buttons highlight when I hover over them, nothing happens when I click on one. This is with Firefox, Chrome, and Safari. Not sure what additional information you would like on this. |
Andrew Stacey 118 posts |
And another one, this time in how maruku parses its meta-data. It would seem that not leaving a space at the end of Presumably this is the case here as well:
I get:
in the source. |
admin
Administator
63 posts
edited 12 years ago |
This was actually only a problem for IALs attached to (This commit gives the complete solution. Its predecessor was only a partial fix.) (N.b.: Maruku is now unvendored, so a
will pull in the latest version from Github.)
Works fine for me under Lion. (I haven’t updated to Mountain Lion, so I can’t make any promises about that. But I’d be surprised if there were any OS dependence of this; it ought to be a function of the Javascript engine in your browser. Or perhaps I misunderstood: were you running the server on Lion, or just the client?) |
Andrew Stacey 118 posts |
I know you don’t believe in the Cache Bug … I had a page on the nLab which I renamed. Looking at the logs, then I see the save command. It ends with:
The next log items are:
There are then a slew of more expirations, the first ones being I just tried on my course wiki. Here are the steps I took:
Result: the expiration sweep does not include the old name and includes the new name twice. I’m wondering if this could be the culprit:
I notice that in the Perhaps the |
distler Moderator 123 posts |
Sorry, I follow exactly the steps you outlined, and it’s The scenario you outline (involving the old name being forgotten before the cache gets swept) is exactly what the Now, the only thing I can think of is that I tested this under |
Andrew Stacey 118 posts |
I just tried on a completely fresh install and found that it happened just as you described: the name used was the old name (and it gets swept twice). That was a sqlite3 database. I’ve tried to install mysql on my mac to test this there, but get to a crash when I run instiki. Not sure why, seems to be related to the gem not finding my mysql lib files but it’s taken too much of my time already to try to fix it to test further. I can try it on my linux machine later. However, the evidence certainly suggests that there is a difference between mysql and sqlite3 on this one. |
Andrew Stacey 118 posts |
There would appear to be a bug on pages with apostrophes in their names. See http://nforum.mathforge.org/discussion/4757/apostrophes-in-page-titles-lead-to-weird-behaviour for details. |
distler Moderator 123 posts |
I’m sorry. Could you please distill that long and rambling discussion in to a set of steps by which one might reproduce the bug? |
Francesco Ta... 6 posts |
In the process of migrating my wiki from Textile to Markdown I think I found a bug: The following snippet of text:
|
distler Moderator 123 posts |
Pandoc is clearly weird. But you have uncovered a regression in Maruku. I’ve fixed that bug in the latest version in my repository on Github.
will fix the problem. |
Francesco Ta... 6 posts |
Fixed. Thanks! |
Andrew Stacey 118 posts |
Distillation for Distler (sorry, …)
|
Andrew Stacey 118 posts |
… and in the time since you asked for clarification, it would appear that you’ve fixed it anyway as it no longer appears having just updated instiki. Thanks. |
distler
Moderator
123 posts
edited 11 years ago |
I am fairly certain that none of my recent updates would affect this scenario.. But I’m happy to hear that it fixed itself. |
Andrew Stacey 118 posts |
I think I’ve killed the cache bug! I did a fresh install of Instiki+MySQL on a debian virtual machine and … no cache bug. So I went back to my live installs and … cache bug. Poking around, I discovered that my fresh install was using version 2.9.1 of the mysql gem but the live installs were using 2.8.1. So, on a hunch, I updated to 2.9.1 and tried reproducing the cache bug … and it had gone. I don’t know if I’ve well and truly killed it, but the steps I put above were reliably showing it for me on the nlab and on mathsnotes and now that I’ve updated the mysql gem then those steps no longer exhibit it so I figure that’s enough for a small celebration. |
distler Moderator 123 posts |
If there’s a minimum version number for the Curious, though, that this “cache bug” of yours would seem to have nothing to do with … caching. |
Andrew Stacey 118 posts |
I put 2.9.1 in the Gemfile but I don’t know if that’s the minimum value. Interestingly, bundle won’t update to the latest version unless you specify such a minimum. Comparing the logs, then it would appear that something in the mysql module was returning the updated page name when instiki was expecting the old page name, so when instiki swept the cache using what it thought was the old page name, it was actually using the new one and thus the old cache page wasn’t being deleted. |
distler Moderator 123 posts |
Might as well assume that
Correct. If you don’t specify a version, then any version is supposed to suffice. |
Andrew Stacey 118 posts |
Spoke too soon. The cache bug is not dead. I shoved in a load of Anyway, what I found was interesting. I got different behaviour depending on whether I was creating a new revision or updating an old one (to switch between the two I used two author strings). Here’s the “same author” sequence of events:
As I said above, only the But here’s what happens when I change the author name to force a new revision:
Notice that the With this sequence then the Looking at the two different sequences of events, it would seem that the safest place to sweep the cache is when Of course, my analysis may well be incorrect as instiki (well, ruby-on-rails) is very much a black box to me so I have no idea as to what’s going on under the bonnet. Incidentally, the above was carried out using sqlite as the database, but I got the same results with mysql with the updated gem. |
distler Moderator 123 posts |
Since I’ve not had much success reproducing your bug, why don’t we see whether implementing your suggestion fixes it for you? Apply the following patch:
|
Andrew Stacey 118 posts |
I’ve put those changes in place and will keep an eye on what happens. Incidentally, when manually clearing out the cache I note that |
Andrew Stacey 118 posts |
With the above changes, then
|
Andrew Stacey 118 posts |
There’s a bug with maruku’s table handling: it doesn’t like whitespace at the end of the line (a previous version did, and it would seem to me that whitespace here should be fine). This causes tables that used to render to no longer do so. The fix is to modify the regexp for splitting cells: line 515 of
(I notice that this isn’t the same as the version of maruku on github, so don’t know if this would be superseded by updating to the latest version from there.) |
admin Administator 63 posts |
I’m working on updating my branch of Maruku, to incorporate various improvements from trunk. In particular, there are improvements to the table code. So you should check it out… |