sun-dragon-cult / fvtt-system-rqg

Runequest Glorantha Foundry VTT system
https://sun-dragon-cult.github.io/
Other
19 stars 2 forks source link

Switching Cult from Lay Member to Initiate Double Adds Common Rune Magic to Character Sheet #692

Closed claycle closed 3 months ago

claycle commented 4 months ago

What

With some cults (I noticed this with Seven Mothers from the Compendium and from a local copy), when using the Edit Cult function on the character sheet to switch the character's status from Lay Member to Initiate, the common rune magic spells are added to the character sheet twice.

How: To Reproduce

  1. Drop a cult item (eg, Seven Mothers) on to the character sheet, either from the compendium or from a local copy.
  2. Right click on the cult name on the sheet, select Edit Cult, and toggle the cult from Lay Member to Initiate.

Expected behavior

The sheet should only have one copy of the common rune magic spells.

Screenshots

Screenshot 2024-01-27 at 10 11 57 AM Screenshot 2024-01-27 at 10 12 21 AM Screenshot 2024-01-27 at 10 12 39 AM Screenshot 2024-01-27 at 10 12 53 AM Screenshot 2024-01-27 at 10 13 15 AM

Environment - please paste the information from foundry settings tab "support" button:

Foundry Virtual Tabletop: Version 11 Stable, 11.315 Game System: rqg, 3.4.1 Active Modules: 30 Performance Mode: 1

OS: Unknown Client: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36 GPU: ANGLE (ATI Technologies Inc., AMD Radeon Pro Vega 64 OpenGL Engine, OpenGL 4.1) Max Texture Size: 16384

Scene: 10558.293047805282 x 7975 | Grid Size: 275 | Padding Percentage: 0.25 Walls: 0 | Ambient Lights: 0 | Ambient Sounds: 0 | Tiles: 0 | Tokens: 0

Actors: 13 | Items: 537 | Journal Entries: 377 | Rollable Tables: 0 | Playlists: 1 | Compendium Packs: 57 | Chat Messages: 1

Additional context

This wasn't happening a few days ago? You are more than welcome to pop into the instance and look around.

wake42 commented 4 months ago

I followed the steps (create character - add seven mothers cult - change cult rank to initiate) but I couldn't recreate the bug.

For background - the common runemagic items is actually added to the actor when you drag the cult to it, but they are hidden if you are not a lay member. It would be interesting to have a look at your world to see if I could find a reason for this. But for starters - could you try one more time with a freshly created actor to drag the seven mother cult from the wiki compendia and then set the cult rank to initiate.

Could you please also have a look at the seven mothers cult - does it look like this, with one and only one of each rune magic spell. image

Also what version of the wiki module do you have installed (the latest is v1.3.0)

...and finally, could you export that actor to json and add it here so I could have a look at it.

claycle commented 4 months ago

Sure. I updated to the release today, then started the server and created a new actor, "Testing 7M".

  1. I checked the 7M cult in the compendium. It had single copies of the rune spells.
  2. I dragged the 7M cult item from the compendium to the new actor (after also dragging the hit locations and basic runes groups from the compendium to the character).
  3. I confirmed that the copy of the 7M cult item on the character had single copies of the common rune magic.
  4. I changed the membership level from Lay to Initiate and the bug appeared (double-copies).

I am attaching a screen shot of what I currently see (new actor, compendium 7M version, local 7M on actor):

Screenshot 2024-01-29 at 4 48 10 PM

I have exported the actor and attached it:

fvtt-Actor-testing-7m-NFkyU1ccz4KARS2s.json

claycle commented 4 months ago
Screenshot 2024-01-29 at 4 59 23 PM
wake42 commented 4 months ago

Apparently there is a bug in here somewhere, but I can't reproduce it. If I create a new actor and do what you did in the screenshots above I only get one set of rune magic spells image

I see in the actor json you attached that the actor has 2 copies of each rune magic spell, so it's not some kind of display problem.

Could you just for trying to getting rid of any error sources, create a new world, add the wiki module, but no other module and then create an actor like above again. Just to see if there is anything in the world (like one of your 30 modules) that is influencing this. (or just disable all modules and try again)

claycle commented 4 months ago

I removed the cult from the 7M Testing actor, then added a random cult (Daka Fal) and bumped it to initiate. No error. Deleted DF and added back 7Mothers and bumped to initiate. No error.

I dunno!

If I had to guess, there's a thread timing issue somewhere where sometimes it just double-dips.

I will keep my eye open for it and the next time I see it I will try to open the console immediately and see if there's anthing strange in there (something I forgot to do previously).

You are still more than welcome to pop into our instance if you feel compelled, if you PM me I can give a credential.

wake42 commented 4 months ago

I think I'm gonna close this issue for now. I looked at the code and didn't see any obvious (to me) errors, but it's a lot of async stuff happening so you never know 😄. I would understand more if you got less than the spell list in the cult, but can't really see how you could get double.

Please keep an eye out if you see it again and either add a comment to this issue or open a new one (and reference this) if you do.

claycle commented 4 months ago

@wake42

Still happening, though intermittment - hadn't seen it in a few days. Created a new character today, dropped in Orlanth Rex cult, flipped them to Rune Lord and got double spells:

image
claycle commented 4 months ago

Some sort of race condition exists somewhere i guess because I deleted the cult from the sheet, then re-dropped it from the compendium, then flipped it to Rune Lord, and got the expected number of spells.

wake42 commented 4 months ago

I would expect it to be some module that makes this happen. If you try with no active modules (except the wiki module) can you still reproduce it?

claycle commented 3 months ago

Turned off all mods, was able to invoke it on the second attempt (removed cult, added, no error, removed cult, added, error).

image

@wake42

wake42 commented 3 months ago

If you would be fine with giving me access to the world I could have a look to see if I could find anything there. If so please DM me with the login details.

claycle commented 3 months ago

@wake42 Discord (@claycle)

wake42 commented 3 months ago

I could reproduce what you saw in the Arc browser, but not in Edge that also can split tabs. The difference being that Arc keeps two "views" of the same site open at once. I even got into some weird behaviour where I was on the Foundry login screen and Arc kept opening new views without me doing anything. I'm going to drop this bug as an Arc bug for now.