Applied Effect with Description creates toggleable temporary effect in Effects tab with no display text when applied to actor

Issue #290 resolved
Ben Freeland created an issue

Setup

foundry: 0.8.8
dnd5e: 1.4.2
obsidian: 5.0.17

Steps To Reproduce

  1. Create Character sheet
  2. Click to add custom feature
  3. Create Effect with a Saving Throw with a high fixed DC (eg. 30)
  4. Create Effect with Applied Effect targeting first effect (applied by Failed Save) and a Description effect
  5. Drag character sheet to scene to create token
  6. Target token
  7. Click the feature
  8. On the message in chat click the checkmark to trigger the Save effect on the token
  9. Open the Effects tab on the character’s sheet

Expected

I was originally hoping that the description would display in the toggleable effect, but going through the code it looks like no toggleable effect should be generated for effects without a functional active affect, so I believe the intention is that nothing should display.

Observed

A temporary effect is displayed with the name of the feature, and the label of the applied effect, but no display text (eg. “testEffect:”)

I’ve attached an exported character sheet in this state.

Notes:

I stumbled across this while trying to create a persistent effect with a description linked to a condition such as Stunned or Poisoned, so that I could include information about the nature of a condition which persists beyond the duration of combat (eg. “Lasts for 1 hour” or “Can only be removed with Wish”). Via experimentation and code analysis I realized now that conditions applied by effects without a combat duration are not tied to the effect once applied, so that isn’t really possible with the current active effects implementation. Still I stumbled across this by accident in the process and thought it worth reporting.

I think the cause of this issue is on line 214 of js/module/duration.js:

effects = effects.filter(e => e.components.length);

Even though the description doesn’t add any active properties to the effect it causes the component length to be non-zero and prevents the effect from being filtered out.

Comments (1)

  1. Log in to comment