typhonjs-fvtt / typhonjs-quest-log

This module provides comprehensive Quest Log system for players and Game Masters to use with Foundry Virtual Tabletop
Other
19 stars 0 forks source link

[BUG] Cannot open quest log from GM login due to one seemingly corrupted file #36

Closed ChrisAndelin closed 3 years ago

ChrisAndelin commented 3 years ago

Module Version: v0.0.0 (idk but I was up to do as of 5/29/2021 at 8:30 pm)

Describe the bug I got the screenshotted error when I was on a GM account and I clicked the button in the journal to open the quest log. It started after one of the players had viewed the quest for the first time and maybe did something to it like completed it or something. Player logins do not have the problem.

To Reproduce Steps to reproduce the behavior:

  1. create the quest from the file shown below (the file data currently seems to be corrupted and I don't have the before-corrupted version of the data)
  2. Mid session with multiple players of varying admin levels have one on TRUSTED modify the quest, maybe mark as completed. I think the player is voice chat said, "What will it let me do with this quest? Can I just complete it?" :shrug:
  3. From the GM account, try to click the button to open the quest log.
  4. Observe that the quest log does not open and observe the console and see the error output screenshotted.

Expected behavior The GM should be able to open the main quest log UI and not have errors.

Screenshots here's the error when you click the "open log" button image

Browser: it's a multi-user repro and idk what all browsers everyone was using. I was using Chrome and Foundry native app

Foundry Version: happened on 0.7.10 and persists into 0.8.6

Game System: dnd5e

Additional context Here's the journal entry for the quest that seems to be the problem. `{"giver":null,"title":"Tuppet's Farm","status":"active","description":"

A strange smell of death has been spreading out from the area around Tuppet's farm and no one has heard from them lately.

","gmnotes":"","personal":false,"image":"actor","giverName":"actor","giverImgPos":"center","splashPos":"center","splash":"","parent":null,"subquests":["EOMoqmx6YuIWd1LV","l6QFTdfkEOVPuFgo","W1geW0weynmu01YY"],"tasks":[{"name":"Find the Briny Cave","completed":true,"failed":false,"hidden":false},{"name":"Deal with whatever creatures might have been drawn to the area","completed":false,"failed":false,"hidden":false},{"name":"Find the cause of the saltwater incursion","completed":false,"failed":false,"hidden":false}],"rewards":[{"type":"Abstract","data":{"name":"1000 Experience Points","img":"icons/svg/mystery-man.svg"},"hidden":false},{"type":"Item","data":{"name":"Ring of Unity","permission":{"default":-1,"3vj6dkkvd3lyWwqi":3},"type":"equipment","data":{"description":{"value":"

\n\t\t\t Ring, minor tier, rare (requires attunement) \n\t\t\t \n\t\t\t\t

\n\t\t\t\t

\n\t\t\t \n\t\t \n\t\t

\n\t\t

This silver ring's band is fashioned to resemble a chain of tiny humanoid figures, locked arm in arm.

Multiple characters may attune to this ring during a single short rest, but only a single one may wear it.

The ring has 5 charges and regains [[/r 1d4+1]] charges at dawn. If you are wearing the ring and deal damage to a creature, you may expend a charge and deal an extra die of damage to that creature.

The size of the ring's damage die starts at [[/r 1d4]] and increases for every character attuned to it -- having two attuned characters will give the die a [[/r d6]], having three will give it a [[/r d8]], and so on, to a maximum of [[/r d12]].

","chat":"","unidentified":""},"source":"BMR","quantity":1,"weight":0,"price":null,"attuned":true,"attunement":1,"equipped":true,"rarity":"Rare","identified":true,"activation":{"type":"","cost":0,"condition":""},"duration":{"value":null,"units":""},"target":{"value":null,"width":null,"units":"","type":""},"range":{"value":null,"long":null,"units":""},"uses":{"value":5,"max":5,"per":null},"consume":{"type":"","target":null,"amount":null},"ability":"","actionType":"","attackBonus":0,"chatFlavor":"","critical":null,"damage":{"parts":[],"versatile":""},"formula":"","save":{"ability":"","dc":null,"scaling":"spell"},"armor":{"value":null,"type":"","dex":null},"hp":{"value":0,"max":0,"dt":null,"conditions":""},"speed":{"value":null,"conditions":""},"strength":null,"stealth":false,"proficient":true},"folder":"YjQwpMvJ585uGBFX","sort":1100001,"flags":{"srd5e":{"page":"items.html","source":"BMR","hash":"ring%20of%20unity_bmr","data":{"item":{"name":"Ring of Unity","type":"RG","tier":"minor","rarity":"rare","source":"BMR","reqAttune":true,"entries":["This silver ring's band is fashioned to resemble a chain of tiny humanoid figures, locked arm in arm.","Multiple characters may attune to this ring during a single short rest, but only a single one may wear it.","The ring has 5 charges and regains {@dice 1d4+1} charges at dawn. If you are wearing the ring and deal damage to a creature, you may expend a charge and deal an extra die of damage to that creature.","The size of the ring's damage die starts at {@dice 1d4} and increases for every character attuned to it -- having two attuned characters will give the die a {@dice d6}, having three will give it a {@dice d8}, and so on, to a maximum of {@dice d12}."],"charges":5,"recharge":"dawn","uniqueId":"8d42340e68a2b83bb7ee7fe7ab1a507f","_isEnhanced":true,"_category":"Other","_typeListText":["ring"],"_typeHtml":"ring","_attunement":"(requires attunement)","_attunementCategory":"Requires Attunement","_fProperties":[],"_fMisc":["Magic","Charges"],"_fValue":0,"_fTier":["minor"],"_fIsMundane":false,"_fBaseItem":[],"_fBonus":[],"_vType":"Ring"}}}},"img":"modules/plutonium/media/icon/ring.svg","effects":[],"_id":"20GkB1aWpAvmRSVH"},"hidden":false},{"type":"Item","data":{"name":"Kuo Toa Plate","permission":{"default":-1,"3vj6dkkvd3lyWwqi":3},"type":"equipment","data":{"description":{"value":"

\n Heavy armor (plate armor), rare \n \n 1,500 gp, 65 lb. \n AC 18 \n \n \n

\n

\n This jagged armor is made of castaway hooks and barbs. While wearing this armor, if you take the Attack action on your turn, you can use a bonus action to try to shove a creature within 5 feet of you (see \"Shoving a Creature\" in chapter 9 of the D&D Basic Rules). The shoved creature takes [[/r 1d8]] piercing damage, in addition to either being knocked prone or pushed.

\n If you are hit with an unarmed attack, the attacker takes [[/r 1d8]] piercing damage.

\n The wearer has disadvantage on Dexterity (Stealth) checks.

\n If the wearer has a Strength score lower than 15, their speed is reduced by 10 feet.

\n ","chat":"","unidentified":""},"source":"","quantity":1,"weight":65,"price":1500,"attuned":false,"attunement":0,"equipped":true,"rarity":"Rare","identified":true,"activation":{"type":"","cost":0,"condition":""},"duration":{"value":null,"units":""},"target":{"value":null,"width":null,"units":"","type":""},"range":{"value":null,"long":null,"units":""},"uses":{"value":0,"max":0,"per":null},"consume":{"type":"","target":null,"amount":null},"ability":"","actionType":"","attackBonus":0,"chatFlavor":"","critical":null,"damage":{"parts":[],"versatile":""},"formula":"","save":{"ability":"","dc":null,"scaling":"spell"},"armor":{"value":18,"type":"heavy","dex":0},"hp":{"value":0,"max":0,"dt":null,"conditions":""},"speed":{"value":null,"conditions":""},"strength":15,"stealth":true,"proficient":true},"folder":null,"sort":700001,"flags":{"srd5e":{"page":"items.html","source":"LoRDToB","hash":"dead%20man's%20plate_lordtob","data":{"item":{"name":"Dead Man's Plate","source":"LoRDToB","page":0,"srd":true,"baseItem":"plate armor|PHB","type":"HA","rarity":"rare","weight":65,"value":150000,"ac":18,"strength":"15","stealth":true,"entries":["This jagged armor is made of castaway hooks and barbs. While wearing this armor, if you take the {@action Attack} action on your turn, you can use a bonus action to try to shove a creature within 5 feet of you (see \"Shoving a Creature\" in chapter 9 of the D&D Basic Rules). The shoved creature takes {@damage 1d8} piercing damage, in addition to either being knocked {@condition prone} or pushed."],"fluff":{"_itemFluff":{"name":"Dead Man's Plate","source":"LoRDToB"}},"uniqueId":"e408f9a6f2ebdd08753669f3f7ca8933","_isEnhanced":true,"_category":"Other","_fullEntries":["This jagged armor is made of castaway hooks and barbs. While wearing this armor, if you take the {@action Attack} action on your turn, you can use a bonus action to try to shove a creature within 5 feet of you (see \"Shoving a Creature\" in chapter 9 of the D&D Basic Rules). The shoved creature takes {@damage 1d8} piercing damage, in addition to either being knocked {@condition prone} or pushed.","The wearer has disadvantage on Dexterity ({@skill Stealth}) checks.","If the wearer has a Strength score lower than 15, their speed is reduced by 10 feet."],"_typeListText":["heavy armor"],"_typeHtml":"heavy armor (plate armor)","_attunement":null,"_attunementCategory":"No Attunement Required","_fProperties":[],"_fMisc":["SRD","Magic"],"_fValue":1500,"_fTier":["none"],"_fIsMundane":false,"_fBaseItem":["plate armor|phb"],"_fBonus":[],"_vType":"Heavy armor"}}},"magicitems":{"enabled":false,"equipped":false,"attuned":false,"charges":"0","chargeType":"c1","destroy":false,"destroyFlavorText":"reaches 0 charges: it crumbles into ashes and is destroyed.","rechargeable":false,"recharge":"0","rechargeType":"t1","rechargeUnit":"r1","sorting":"l"}},"img":"systems/dnd5e/icons/items/armor/plate.png","effects":[{"_id":"pSvMKK46Iw3iOl9U","flags":{},"changes":[{"key":"data.attributes.ac.value","value":18,"mode":4,"priority":4}],"disabled":false,"duration":{"startTime":null,"seconds":null,"rounds":null,"turns":null,"startRound":null,"startTurn":null},"icon":"systems/dnd5e/icons/items/armor/plate.png","label":"Base AC","tint":"","transfer":true}],"_id":"KtJD2pzYHqTNjAeP"},"hidden":true},{"type":"Item","data":{"name":"Spell Siphon Amulet","permission":{"default":-1,"3vj6dkkvd3lyWwqi":3},"type":"equipment","data":{"description":{"value":"

\n Wondrous item, rare (requires attunement by a warlock) \n \n

\n

\n \n \n

\n

\n This amulet consists of a golden disc set with a brilliant star ruby. It seems to draw in ambient magic and glows in the presence of extremely powerful magical auras.

\n While wearing this amulet, whenever a single target spell targets you, you can use your reaction to force the caster creature to make a saving throw using their spell casting modifier against your spell save DC. On a failure, you gain a single spell slot and the spell targeting you has no effect. Make this roll before rolling your saving throw.

\n ","chat":"","unidentified":""},"source":"","quantity":1,"weight":0,"price":null,"attuned":true,"attunement":1,"equipped":true,"rarity":"Rare","identified":true,"activation":{"type":"reaction","cost":1,"condition":"Targeted by a single target spell"},"duration":{"value":null,"units":""},"target":{"value":1,"width":null,"units":"","type":"creature"},"range":{"value":null,"long":null,"units":""},"uses":{"value":0,"max":"0","per":""},"consume":{"type":"","target":"","amount":null},"ability":"","actionType":"","attackBonus":0,"chatFlavor":"","critical":null,"damage":{"parts":[],"versatile":""},"formula":"","save":{"ability":"","dc":null,"scaling":"spell"},"armor":{"value":null,"type":"trinket","dex":null},"hp":{"value":0,"max":0,"dt":null,"conditions":""},"speed":{"value":null,"conditions":""},"strength":null,"stealth":false,"proficient":true},"folder":"YjQwpMvJ585uGBFX","sort":1000001,"flags":{"srd5e":{"page":"items.html","source":"CrazyJarlsDiscountMagicShop","hash":"mage%20siphon%20amulet_crazyjarlsdiscountmagicshop","data":{"item":{"name":"Mage Siphon Amulet","source":"CrazyJarlsDiscountMagicShop","rarity":"rare","reqAttune":"by a sorcerer","wondrous":true,"entries":["This amulet consists of a golden disc set with a brilliant star ruby. It seems to draw in ambient magic and glows in the presence of extremely powerful magical auras.","While wearing this amulet, whenever a spell you cast targets a single hostile creature, that creature must make a Wisdom saving throw against your spell save DC. On a failure, you gain a single sorcery point."],"reqAttuneTags":[{"class":"sorcerer"}],"uniqueId":"1d5bba431af5d68237b81d3b1b840321","_isEnhanced":true,"_category":"Other","_typeListText":["wondrous item"],"_typeHtml":"wondrous item","_attunement":"(requires attunement by a sorcerer)","_attunementCategory":"Requires Attunement By...","_fProperties":[],"_fMisc":["Magic"],"_fValue":0,"_fTier":["none"],"_fIsMundane":false,"_fBaseItem":[],"_fBonus":[],"_vType":"Wondrous item"}}},"magicitems":{"enabled":true,"equipped":true,"attuned":true,"charges":"0","chargeType":"c1","destroy":false,"destroyFlavorText":"reaches 0 charges: it crumbles into ashes and is destroyed.","rechargeable":false,"recharge":"0","rechargeType":"t1","rechargeUnit":"r1","sorting":"l"}},"img":"modules/plutonium/media/icon/crossed-swords.svg","effects":[],"_id":"wYKiuZwOPsJVCGZv"},"hidden":true}]}`

Thwakamazog commented 3 years ago

Having a very similar issue myself. Quest entries are simply disappearing, or becoming unresponsive while adding them.

image

xdy commented 3 years ago

As noted in a comment on #32 the reason is that pasting from the browser contains \n characters (and possibly other problematic characters), which makes the json parsing fail. See comments on #32 or #40 for a possible workaround. Closing this as duplicate of #32