H
HASS.Agent•12mo ago
DrR0x

Error adding custom command

Specs Version: 2023.11.1-ubeta The friendly name of commands is copied from the actual name always, therefore it is not modifiable. Steps to reproduce NGL, idk What I did: 1. Create new custom command 2. Named it different with the command cmd 3. Clicked store & activate 4. Error box popped up asking me to check the logs Log snippet
[FTL] [PROGRAM] FirstChanceException: Index was out of range. Must be non-negative and less than the size of the collection. (Parameter 'index')
System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection. (Parameter 'index')
at System.Collections.Generic.List`1.RemoveAt(Int32 index)
at HASS.Agent.Commands.CommandsManager.StoreAsync(List`1 commands, List`1 toBeDeletedCommands) in D:\Programowanie\Visual CS\Projects\HASS.Agent.Staging\src\HASS.Agent.Staging\HASS.Agent\Commands\CommandsManager.cs:line 0
2023-12-11 12:20:24.231 +11:00 [FTL] [COMMANDSMANAGER] Error while storing: Index was out of range. Must be non-negative and less than the size of the collection. (Parameter 'index')
System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection. (Parameter 'index')
at System.Collections.Generic.List`1.RemoveAt(Int32 index)
at HASS.Agent.Commands.CommandsManager.StoreAsync(List`1 commands, List`1 toBeDeletedCommands) in D:\Programowanie\Visual CS\Projects\HASS.Agent.Staging\src\HASS.Agent.Staging\HASS.Agent\Commands\CommandsManager.cs:line 0
[FTL] [PROGRAM] FirstChanceException: Index was out of range. Must be non-negative and less than the size of the collection. (Parameter 'index')
System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection. (Parameter 'index')
at System.Collections.Generic.List`1.RemoveAt(Int32 index)
at HASS.Agent.Commands.CommandsManager.StoreAsync(List`1 commands, List`1 toBeDeletedCommands) in D:\Programowanie\Visual CS\Projects\HASS.Agent.Staging\src\HASS.Agent.Staging\HASS.Agent\Commands\CommandsManager.cs:line 0
2023-12-11 12:20:24.231 +11:00 [FTL] [COMMANDSMANAGER] Error while storing: Index was out of range. Must be non-negative and less than the size of the collection. (Parameter 'index')
System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection. (Parameter 'index')
at System.Collections.Generic.List`1.RemoveAt(Int32 index)
at HASS.Agent.Commands.CommandsManager.StoreAsync(List`1 commands, List`1 toBeDeletedCommands) in D:\Programowanie\Visual CS\Projects\HASS.Agent.Staging\src\HASS.Agent.Staging\HASS.Agent\Commands\CommandsManager.cs:line 0
Solution:
ok, I have a fix for this and in the meantime found 2 more bugs 😄
Jump to solution
8 Replies
DrR0x
DrR0xOP•12mo ago
Just to be clear, it only sometimes does this, only happened once
Amadeo
Amadeo•12mo ago
hm, on 2.0.0 it seems to be working for me
Amadeo
Amadeo•12mo ago
or I'm not replicating all steps correctly did you by any chance: 1. added custom command (without publishing) 2. removed custom command 3. clicked save & publish that way I was able to replicate it
Solution
Amadeo
Amadeo•12mo ago
ok, I have a fix for this and in the meantime found 2 more bugs 😄
DrR0x
DrR0xOP•12mo ago
Haha, and I think you may be correct on adding and removing one. So the error is because it adds a task to delete a command but the command doesn't exist because I deleted it before storing it or something?
Amadeo
Amadeo•12mo ago
ya
DrR0x
DrR0xOP•12mo ago
Makes sense
Want results from more Discord servers?
Add your server