Whenever I make a roll in DND5E with Midi-QOL, I get the following error:
Foundry.js:753 TypeError: undefined. Cannot read properties of undefined (reading 'length') [Detected 2 packages: dice-stats, midi-qol] at PLAYER.saveRoll (dice-stats-player.js:96:55) at dice-stats-main.js:264:24 at Array.forEach (<anonymous>) at DiceStatsTracker.addRoll (dice-stats-main.js:263:15) at Object.fn (dice-stats-hooks.js:36:38) at hookCall (utils.js:4863:16) at asyncHooksCallAll (utils.js:4815:10) at Workflow.WorkflowState_RollFinished (workflow.js:1513:9) at async Workflow.performState (workflow.js:478:21)
It looks like saveRoll expects a single argument, msgRollInfo, but where it's being called from the Midi hook, it's being passed in three arguments.
Unrelated to this issue, I noticed in the readme for the module that when merged cards are enabled in Midi, you have to do some hacks to try to guess at the user who actually made the roll that aren't reliable. I don't know if the Midi workflow has changed since you last looked into this or if I'm just misunderstanding what's required, but it seems like workflow.chatCard.user will give you the user who made the roll, and workflow.chatCard.user._id could be sent in to addRoll as the owner.
Whenever I make a roll in DND5E with Midi-QOL, I get the following error:
Foundry.js:753 TypeError: undefined. Cannot read properties of undefined (reading 'length') [Detected 2 packages: dice-stats, midi-qol] at PLAYER.saveRoll (dice-stats-player.js:96:55) at dice-stats-main.js:264:24 at Array.forEach (<anonymous>) at DiceStatsTracker.addRoll (dice-stats-main.js:263:15) at Object.fn (dice-stats-hooks.js:36:38) at hookCall (utils.js:4863:16) at asyncHooksCallAll (utils.js:4815:10) at Workflow.WorkflowState_RollFinished (workflow.js:1513:9) at async Workflow.performState (workflow.js:478:21)
It looks like saveRoll expects a single argument, msgRollInfo, but where it's being called from the Midi hook, it's being passed in three arguments.
Unrelated to this issue, I noticed in the readme for the module that when merged cards are enabled in Midi, you have to do some hacks to try to guess at the user who actually made the roll that aren't reliable. I don't know if the Midi workflow has changed since you last looked into this or if I'm just misunderstanding what's required, but it seems like
workflow.chatCard.user
will give you the user who made the roll, andworkflow.chatCard.user._id
could be sent in to addRoll as the owner.