Steps to replicate the issue
- As reported on [[:en:w:Wikipedia talk:AutoWikiBrowser]], create a C# module with Regex.Replace, using an insanely complex RE (that happens to contain \r characters, although removing them does not help).
- Start to load [[:en:w:German Empire]].
What happens?:
AWB hangs indefinitely (the green bar just animates continuously).
What should have happened instead?:
AWB completes the RE evaluation in 40-50 seconds on a typical laptop, as it does when the equivalent RE replacement is specified in the Advanced F/R instead..
Software version (skip for WMF-hosted wikis like Wikipedia):
AWB 6.2.1.1
The problem is circumvented by removing \r characters from ArticleText before calling the custom module. However, I haven't analyzed why that makes a huge difference, and whether that would introduce any regressions. Sample fix: in Article.cs:SendPageToCustomModule, replace
string strTemp = module.ProcessArticle(processArticleEventArgs.ArticleText,
with
string localText = Tools.ConvertFromLocalLineEndings(processArticleEventArgs.ArticleText); string strTemp = module.ProcessArticle(localText,
and
_customModuleMadeChanges = !strTemp.Equals(processArticleEventArgs.ArticleText);
with
_customModuleMadeChanges = !strTemp.Equals(localText);