ID 522699 - The last deleted Channel is still accessible via Python

Follow

Problem summary
The last deleted Channel is still accessible via Python
 
Customer reported version
Mari 5.0v4
 
Customer reported platform
CentOS 7
 
Steps to reproduce
 
1) Open any project

2) Create three Channel nodes: Channel1, Channel2, and Channel3

3) Delete Channel3
 
4) Run the following script to get a list of Channels in the projects and their names:
 
print(mari.geo.current().channelList())for c in mari.geo.current().channelList():	print(c.name())
 
Expected behaviour
Only Channel1 and Channel2 should be returned:
 

[<mari.Channel(0x1dba7c54e20) at 0x000001DB3133BD00>, <mari.Channel(0x1dba7c54bb0) at 0x000001DB31372A40>]

Channel1

Channel2

 

Actual behaviour
Channel3 also gets returned:

 [<mari.Channel(0x1dba7c54e20) at 0x000001DB3133BD00>, <mari.Channel(0x1dba7c54bb0) at 0x000001DB31372A40>, <mari.Channel(0x1dba7c442c0) at 0x000001DB3137F180>]

Channel1

Channel2

Channel3

 

If the user now deletes Channel2 and runs the script again: Channel3 doesn't get returned, but Channel2 does.
 
If the user deleted multiple Channels at once, only one of them still gets returned.

Workaround
Saving, closing and reopening your Project will fully remove the deleted Channels.
Additionally, creating a new Channel also fully updates the channelList.
 
Reproduced by support
This bug has been reproduced in:
Mari 6.0v2 - Windows 10 - CentOS 7.9
Mari 5.0v4 - Windows 10 - CentOS 7.9
Mari 4.8v4 - Windows 10 - CentOS 7.9 - regression
 
Unable to reproduce bug in:
Mari 5.0v3 - Windows 10 - CentOS  7.9
 
Earliest version tested
Mari 5.0v3 - This issue doesn't appear in this version and has regressed
 

    We're sorry to hear that

    Please tell us why