Larkinabout / fvtt-challenge-tracker

An interactive aid to track successes and failures in challenges à la D&D 4e-inspired skill challenges and Blades in the Dark progress clocks.
MIT License
5 stars 2 forks source link

[Bug?] Can't delete old trackers #36

Open steveculshaw opened 1 year ago

steveculshaw commented 1 year ago

I'm finding I can't delete old trackers ...

image

And the console is showing ...

image

And if I try and open one, I get an error ...

image

And the console is showing ...

image
SalieriC commented 6 months ago

Did this happen to you when using the API function to open a challenge tracker? I have the same issue if I do so but creating one from the UI is fine. So it appears to be an issue in the API. Also after reloading I could delete the old trackers just fine so at least there is that.

steveculshaw commented 6 months ago

Never used the API, just the dialog

SalieriC commented 6 months ago

Weird. I am currently fiddling around with the old Macros for Swade Macro for creating Dramatic Tasks and had this issue appear. Never managed to get a similar issue with the UI but on closer inspection I seem to have a different error message as well. Apparently the module needs some amount of work. Shame the author appears to be MIA, it's been a staple for my games.

Larkinabout commented 6 months ago

Weird. I am currently fiddling around with the old Macros for Swade Macro for creating Dramatic Tasks and had this issue appear. Never managed to get a similar issue with the UI but on closer inspection I seem to have a different error message as well. Apparently the module needs some amount of work. Shame the author appears to be MIA, it's been a staple for my games.

If you can figure out the steps to reproduce, I can have a look, but it hasn't been a top priority for me as it's been otherwise stable and I've not had the issue occur on my end.

SalieriC commented 6 months ago

If you can figure out the steps to reproduce, I can have a look, but it hasn't been a top priority for me as it's been otherwise stable and I've not had the issue occur on my end.

Good to hear you're still around. =) I took a look at it this morning before work. Haven't figured it out entirely though. But for me it only happens to trackers created using the API and only before a reload after creation. The issue in this case is that the owner ID is not passed to the unset function here: https://github.com/Larkinabout/fvtt-challenge-tracker/blob/be3fdf61a4e985e047f2f42187af32b76214a722/scripts/flags.js#L69 This results in a "null or undefined" error message. Maybe I use the API function to create the tracker incorrectly though, I can send you the code if you think this might be the case. But after a reload of the world it works fine. Also if I add

if (!ownerId) {
  ownerId = game.userId
}

in line 70 it works just fine. This will probably break if handling trackers for other players but it is proof the ID isn't properly passed to the function for some reason. I couldn't investigate further yet as I had to start with work.

This is not the same error @steveculshaw is experiencing however. I can't reproduce his problem either.