Roku Developer Program

Join our online forum to talk to Roku developers and fellow channel creators. Ask questions, share tips with the community, and find helpful resources.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
johnmarsden
Visitor

Hilarious Roku bug of the day: .delete(xyz)

I found that using
listObject.delete(index)


wasn't working 100% as expected. If I tried to access objects in there later, the list didn't shift.. or something. Not sure what exactly happens behind the scenes, but it wasn't working correctly.

I would delete index #1 at some point.. then add another.. then try to access listObject[1], which would always crash; consistently.

Then I tried debugging it by doing:


listObject.delete(index)
print listObject


and it would print the object out as expected... but also, it didn't break anymore. 
This is 100% consistent. I tested multiple times, multiple scenarios, with and without the print log. I did it with the debugger on and off. 
When the print command was commented out... it crashed. 
When the print command was uncommented... it worked. 
Every. Single. Time.
0 Kudos
5 REPLIES 5
johnmarsden
Visitor

Re: Hilarious Roku bug of the day: .delete(xyz)

Also tried a variety of these mixtures:

listObject.delete(index);

' listObject = listObject   FAIL
' print listObject.peek()   FAIL
' print listObject.count()   FAIL
' print listObject[0]       WORKS
' print listObject           WORKS
' print listObject.resetIndex() WORKS


Shaking my head in disbelief. 
0 Kudos
joetesta
Roku Guru

Re: Hilarious Roku bug of the day: .delete(xyz)

schrodingers cat?  it only resolves when you force it to by looking at it first.
aspiring
0 Kudos
NB_
Roku Guru

Re: Hilarious Roku bug of the day: .delete(xyz)

my naive attempt to repro failed. not even sure if that was about roList or else.
MWE, please?
0 Kudos
johnmarsden
Visitor

Re: Hilarious Roku bug of the day: .delete(xyz)

"RokuNB" wrote:
my naive attempt to repro failed. not even sure if that was about roList or else.
MWE, please?

That might be pretty tough to make considering the structure. I could maybe try, but in the meantime, any thoughts on why this might be a thing?
0 Kudos
RokuKC
Roku Employee
Roku Employee

Re: Hilarious Roku bug of the day: .delete(xyz)

"johnmarsden" wrote:
"RokuNB" wrote:
my naive attempt to repro failed. not even sure if that was about roList or else.
MWE, please?

That might be pretty tough to make considering the structure. I could maybe try, but in the meantime, any thoughts on why this might be a thing?

From the APIs listed it sounds like you are referring to roList.  Are you creating the list with CreateObject, or getting it from some other source API?
roList is not really a frequently used construct, in my experience.  Generally roArray has better capabilities for most uses.
Are you using roList in conjunction with SceneGraph components or possibly some other unusual scenario?
It's certainly possible that there are bugs, and if so any more detailed information you can provide would be helpful.
0 Kudos
Need Assistance?
Welcome to the Roku Community! Feel free to search our Community for answers or post your question to get help.

Become a Roku Streaming Expert!

Share your expertise, help fellow streamers, and unlock exclusive rewards as part of the Roku Community. Learn more.