Evaluator Group, issues while selecting files after executing rename script

Long title, hopefully explained better below, though.

I've got a evaluator group activated inside a folder. This looks like:
grafik

The evaluator group is defined as below:

if (is_dir) { return [ order = 0; ] };

warranty_yrs = RegExS(name,"(.*)(\[)(\d+)(.*)", "\3");
if (warranty_yrs == name) { return  [ order = 4; name = "irrelevant"; collapse = true ]; };

invoice_date = RegExS(name,"(^\d{4}-\d{2}-\d{2}) (.*)", "\1");

expires_date: date = DatePart(invoice_date,"YYYY-MM-dd");
expires_date = expires_date + ( warranty_yrs +"y" );
if (expires_date == "1601-01-01") { return [ ] };

diff = DateDiff("d", DatePart(Now(),"YYYY-MM-dd"), expires_date);

if (diff < 1)
	{ return [ order = 1; name = "Garantie abgelaufen"; collapse = false ]; }
elseif ( diff >= 1 and diff < 90 )
	{  return [ order = 2; name = "Garantie läuft demnächst ab (~90 Tage)"; collapse = true ]; }
else 
 	{ return [ order = 3; name = "Garantie gültig"; collapse = true ]; };

When saving a new pdf into this folder, from e.g. a download from browser Firefox, this new file automatically pops up in group the group "irrelevant". This is correct and expected unless the file does not get it's final name.

The file has to follow the scheme "date some text [number Jahre Garantie].pdf". For example "2024-02-01 Amazon Reolink Kamera [2 Jahre Garantie].pdf".

To get the appropriate renaming, I've written a rename script that adds the last part of the filename: "[number Jahre Garantie]".

Now, while renaming of the filename works correctly, the behaviour of the lister and the evaluator groups, after renaming, looks and feels weird.

I've tried to show the issue in video below.


The following steps are performed in the video:

  1. Selecting the file to be renamed
  2. Executing the rename script which let me input a number of years that get appended to the filename with above mentioned additional text
  3. After a successful renaming, the file gets sorted into the correct group "Garantie gültig" (not visible in vid, though)

Right after step 3, I try to expand this group in which the renamed file got sorted into. This failed for unknown reason.

But what's even more strange, I cannot select any other files in the lister.
As the vid might show you, I tried to select one of those others files, like "2023-10-24 Flexispot höhenverstellbarer Schreibtisch Garantieversprechen.pdf" and somehow, the folders below got selected instead.
Moreover, a second, duplicate group "irrelevant" appeared for no reason.

Maybe you can reproduce this behaviour? Maybe its solely related to the evaluator group and renaming a file. I don't think the issue is related to the rename script, see coding below.

After refreshing the lister, pressing F5, everything works OK again. E.g. selecting files as does expanding or collapsing the groups.
I'm using DO 13.4. btw.

Rename script:

var WarrantyYearsPopup = false;

function OnGetNewName(getNewNameData)
{
		
	var name = getNewNameData.newname_stem_m;
	var ext = getNewNameData.newname_ext_m;
	var yrs = 2;
	
	if (getNewNameData.Item.Is_Dir)
		return name;
	
	if (DOpus.Vars.Exists("WarrantInYears"))
		yrs = DOpus.Vars.Get("WarrantInYears");

	if (!WarrantyYearsPopup)
	{
		var dlg = DOpus.Dlg;
		//dlg.window = DOpus.Listers(0);
		dlg.message = "Enter Years of Warranty";
		dlg.title = "Warranty";
		dlg.buttons = "OK|Cancel";
		dlg.defvalue = yrs;
		dlg.max = 2;
		var ret = dlg.show;
		
		WarrantyYearsPopup = true;
		
		if (ret == 0)
			//return name;
			return true;
			
		//fetch user input
		yrs = dlg.input;
		if (yrs > 0)
		{
			//save user input and prevent popup from appearing again
			//getNewNameData.custom.years = yrs;
			//getNewNameData.custom.popup = false;
			DOpus.Vars("WarrantInYears") = yrs;
		}
	}

	if (yrs > 0)
	{
		var warranty = String(name).match(/\[\d+.*\]/);
		if (warranty)
			name = name.replace(warranty,"");
		else
			name = name + " ";
				
		name = name + "[" + yrs +" Jahre Garantie]";
	}

	return name + ext;
}

function OnGetCustomFields(getFieldData)
{
}

Just checking in to say we're not ignoring this, but so far haven't been able to reproduce it.

One thing that might help us repro this is a list of the file and folder names in the folder when it happens. (And any other info the rename script or evaluator group depend on, e.g. file dates or content.)