Feu-Secret / Tokenmagic

A Foundry VTT module that allows you to add animations and graphic effects to tokens, tiles, templates and drawings.
GNU General Public License v3.0
52 stars 36 forks source link

Suggestion: Switch to socketLib to provide awaitable addFilters calls. #189

Open tposney opened 2 years ago

tposney commented 2 years ago

Currently, if a player client attempts to do deleteFilters (or addFilters) that request is sent to a GM client for execution, however awaiting those calls returns as soon as the message is sent.

Accordingly a second request can be made before the second has been recorded in the database and the second request may end up setting the workingFlags according to the values before the first effect has completed - resulting in an effect being left hanging around.

socketLib supports an awaitable executeAsGM function which only returns when the first deleteFilters has actually completed.

Switching to socketLib would alleviate some race conditions that case DAE pain.

Feu-Secret commented 2 years ago

Hey Tim! Thank you for your suggestion. I think it's a good idea! Scheduled for the next update.

Feu-Secret commented 2 years ago

Waiting for socketlib to be v10 compatible.