SFDigitalServices / formio-sfds

The form.io theme for sf.gov
https://formio-sfds.herokuapp.com/
MIT License
15 stars 2 forks source link

Bug fix: prevent access errors in undefined form.form.properties #224

Closed shawnbot closed 2 years ago

shawnbot commented 2 years ago

I saw some errors that crashed the web app in Papertrail:

Apr 29 00:21:17 formio-sfds app/web.1 /app/src/phrase.js:88
Apr 29 00:21:17 formio-sfds app/web.1       form.properties || form.form.properties,
Apr 29 00:21:17 formio-sfds app/web.1                                    ^
Apr 29 00:21:17 formio-sfds app/web.1 TypeError: Cannot read properties of undefined (reading 'properties')
Apr 29 00:21:17 formio-sfds app/web.1     at Phrase.get props [as props] (/app/src/phrase.js:88:36)
Apr 29 00:21:17 formio-sfds app/web.1     at Phrase.getTranslationInfo (/app/src/phrase.js:100:13)
Apr 29 00:21:17 formio-sfds app/web.1     at module.exports (/app/api/wtf.js:82:27)

This should prevent that specific error from happening, but it's a bigger problem that this took the entire server down. Clearly we need better error handling 😬

github-actions[bot] commented 2 years ago

Size Change: +9 B (0%)

Total Size: 89.7 kB

Filename Size Change
dist/formio-sfds.standalone.js 69.3 kB +9 B (0%)
ℹ️ View Unchanged | Filename | Size | | :--- | :---: | | `dist/formio-sfds.css` | 13.8 kB | | `dist/portal.js` | 6.65 kB |

compressed-size-action