Larkinabout / fvtt-token-action-hud-core

Token Action HUD is a repositionable HUD of actions for a selected token.
13 stars 18 forks source link

[BUG] Constant migration notification #147

Closed apoapostolov closed 1 year ago

apoapostolov commented 1 year ago

Each time the world is reloaded, a notification informs of migrating tags. This might be a bug (flags are migrated once, but notification keeps showing) or maybe flags aren't properly set. FVTT 11 + PF2 5.0.0 beta2

image

Larkinabout commented 1 year ago

In your case, run the following as a macro script:

const actors = game.actors.filter(actor => actor.getFlag('token-action-hud-core', 'categories'))
for (const actor of actors) {
    actor.unsetFlag('token-action-hud-core', 'categories')
}

const users = game.users.filter(user => user.getFlag('token-action-hud-core', 'categories'))
for (const user of users) {
    user.unsetFlag('token-action-hud-core', 'categories')
    user.unsetFlag('token-action-hud-core', 'default')
}

It'll clear out the old flags on all users and actors.

Suldrun45 commented 1 year ago

Same issue on a few worlds (pf2e, latest version), I ran the script above but it doesn't change anything

apoapostolov commented 1 year ago

Same the macro did not work.

On Sat, Jun 17, 2023, 15:05 Suldrun45 @.***> wrote:

Same issue on a few worlds (pf2e, latest version), I ran the script above but it doesn't change anything

— Reply to this email directly, view it on GitHub https://github.com/Larkinabout/fvtt-token-action-hud-core/issues/147#issuecomment-1595724747, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA7FAZBRPFKKBPJI6JH6GOLXLWMSNANCNFSM6AAAAAAZJYMIYE . You are receiving this because you authored the thread.Message ID: @.***>

Larkinabout commented 1 year ago

I'm not able to reproduce this issue. Would one of you please be able to run this code in the browser console and screenshot me the output: game.user.getFlag('token-action-hud-core', 'categories')

Suldrun45 commented 1 year ago

It just says "undefined" when I do that. And when I run the macro, the "actors" and "users" arrays are empty

Larkinabout commented 1 year ago

The script has cleared out the old flags then or the original migration did. What's confusing me is that the first thing the migration does it check whether those flags exist and if they don't it exits the migration. I don't seem to be able to reproduce on my end at all, but I might consider dropping the migration entirely in the next version anyway.

ogsfernandes commented 1 year ago

I'm having this issue too. I'm not sure if it's related, but any changes I make to the HUD such as switching positions between groups or removing them simply revert anytime I reload the game.

Larkinabout commented 1 year ago

@ogsfernandes, do you get any red errors in the browser console? A failure to restore the HUD layout on reload suggests it's either failing to save or retrieve the data from the json files.

ogsfernandes commented 1 year ago

@Larkinabout Actually no, I'm not getting any errors. It doesn't always happens, but everytime me or any of my players get the blue message about succesfully migrated flags, the HUD resets to its original state. I'm not getting the succesfully migrated flags notification anymore (and the HUD isn't resetting), but some of my players are and their layouts reset.

Larkinabout commented 1 year ago

Fixed in Token Action HUD Core 1.4.10.