perf: avoid eager description enrichment in fast consume flow #123
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Athemis/ds4#123
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Expected Behavior
Self-targeted consume effects without target or formula prompts should execute the fast consume path without enriching the item description first. Description enrichment should only happen when the consume flow actually needs dialog content.
Current Behavior
The consume flow eagerly calls description enrichment even when the effect is self-targeted and no dialog is shown. That adds avoidable rich-text processing overhead to the common consume path.
Steps to Reproduce
src/apps/actor/consume-flow.jsonmain.onConsumeItem()path for a self-targeted consume effect withoutallowTargetChange,allowFormulaChange, orprompttarget mode.enrichItemDescription(item)is called before effect execution even though no dialog content is needed.pnpm test:vitest spec/apps/actor/consume-flow.spec.ts.Context
This was found during a performance review of the newer consume-item flow. The cost is moderate rather than catastrophic, but it sits on a high-frequency path and is easy to avoid safely.
Version
main @
4df70e90Foundry VTT Version
Not runtime-specific; identified in the current source path during automated tests.
Operating System
Linux
Browser / App
Other
Relevant Modules
None.