DO12: Annoying crash related to grouping by custom script columns

Sometimes when attempting subsequent inline renames of files or folders, while a folder is grouped by a scripted column, dopus crashes and suggests restarting itself. Unfortunately it doesn't generate a crash dump when it does, and it doesn't happen frequently enough and as such cannot be reliably reproduced.

Related to that might also be that sometimes after prolonged operation it stops grouping or ordering the files in those views altogether - even when forcing refreshes - which is fixed by restarting dopus.

I suspect it's some sort of racing condition with the refreshes made after observing filename changes. It occurs also when creating folders or adding new files by moving/copying to folders with that view as well. No script errors are ever logged by the interpreter.

My script is a customized version of one by wowbagger found on these very forums and I've attached it whole below. If there is anything in it that could be causing the crash or that could be optimized I'm open to suggestions.

Columns.rar (2.3 KB)

In Columns.js I define a (hopefully) reusable reg-ex object:

audioRegEx = /(24bit|32bit|FLAC|256k|320k|VBR|MP3)/i;

Define group names:

groupNames: { "24bit": "24bit", "32bit": "32bit", "MP3": "MP3", "320k": "MP3", "256k": "MP3", "FLAC": "FLAC", "flac": "FLAC", "WAV": "WAV", "VBR": "MP3" }
Force them in order:

groupOrder: "32bit;24bit;FLAC;MP3"

The actual column is hidden even though the view is grouped by it.

Crash affects: ALL dopus versions since 12.00 including latest 12.3.3 beta.
I was hoping to figure out the reason or pattern behind it but had no luck until now so theres no other choice for me but to report what I have on it so far.

Custom columns and the ability to group and sort on them is an essential part of my opus experience so I need it to be flawless when using them. The way it is now - I crash out ~2-5 times a day depending on usage and grouping sorting on them fails a bit less often than that.

Latest beta 1234. Crashed multiple times. Not so rare either.

DOpus.Minidumps.rar (211.9 KB) - 2x dumps

I've written a program which is scanning specific attributes of files in subfolders and generating .type files in their root. Reading those types with the methods below while adding / removing folders leads to more crashes of the same type.

function OnInit(initData) {
    initData.name = "Engine Type";
    initData.desc = "Whatever";
    initData.copyright = "Dev";
    initData.default_enable = true;
    var col1 = initData.AddColumn();
    col1.method = "Method1";
    col1.name = "Engine";
    col1.label = "Engine";
    col1.autogroup = true;
    col1.autorefresh = true;
    col1.justify = "left";
    col1.match.push_back("Yes");
    col1.match.push_back("No");
}


function Method1(scriptColData) { //simple FileExists check

if (!scriptColData.item.is_dir) return;
 if(DOpus.FSUtil.Exists(scriptColData.item + "\\Engine=XS.type")) scriptColData.value  = "XS";
 else if(DOpus.FSUtil.Exists(scriptColData.item + "\\Engine=X1.type")) scriptColData.value  = "X2";
 else if(DOpus.FSUtil.Exists(scriptColData.item + "\\Engine=Y2.type")) scriptColData.value  = "Y2";
 else if(DOpus.FSUtil.Exists(scriptColData.item + "\\Engine=Z3.type")) scriptColData.value  = "Z3";
 else if(DOpus.FSUtil.Exists(scriptColData.item + "\\Engine=EX1.type")) scriptColData.value  = "EX1";
 else if(DOpus.FSUtil.Exists(scriptColData.item + "\\Engine=EX2.type")) scriptColData.value  = "EX2";
 else if(DOpus.FSUtil.Exists(scriptColData.item + "\\Engine=EX3.ype")) scriptColData.value  = "EX3";
 else scriptColData.value  = "";

DOpus.Output(scriptColData.value);
}

function Method2(scriptColData) { //using FSUtil.ReadDir
     
     var enumItems = DOpus.FSUtil.ReadDir(scriptColData.item);
     while (!enumItems.complete) {
     var entry = enumItems.Next;
     	
     if(entry.ext == ".type") {
		DOpus.Output(entry.name_stem);
		scriptColData.value  = entry.name_stem.replace("Engine=","");
		return;
		}	
	}
}

Method 1 takes 15 seconds on 1500 folders with 5-10 files inside each.
Method 2 takes 110 seconds on 1500 folders with 5-10 files inside each.
Doing it with Method2 is way too slow to even consider it.
The last one I can think of is reading a static named file with blobs but that one seems even more ludicrous.

Were any crash dumps created? If so, please email them so we can have a look.

Attached 2 of those to the second post :sunglasses: