nobt-io / frontend

Frontend of nobt.io.
https://nobt.io
GNU General Public License v3.0
10 stars 4 forks source link

TypeError: undefined is not an object (evaluating 'n.props.balance.me') #277

Closed thomaseizinger closed 4 years ago

thomaseizinger commented 4 years ago

https://sentry.io/organizations/nobtio/issues/1312916675/?referrer=github_plugin

TypeError: undefined is not an object (evaluating 'n.props.balance.me')
  at context (./src/routes/App/routes/balances/routes/name/components/PersonBalance/PersonBalance.js:38:34)
  at dispatch (./src/store/crashReporter.js:16:3)
  at next (./src/routes/App/modules/currentNobt/actions.js:20:5)
  at None (./src/store/crashReporter.js:16:3)
  at promiseReactionJob ([native code])
...
(11 additional frame(s) were not displayed)
thomaseizinger commented 4 years ago

Some investigation:

  1. This problem happens for the user "Blair", likely because their name includes a space at the end. This is something we should sanitize in the backend in the future, I've opened https://github.com/nobt-io/api/issues/105 for this.
  2. Interestingly, this issue only happens if one directly navigates to that page. Try the following to re-produce:

a. Go to https://nobt.io/yIGHL7SzDSrJ/balances/Blair, you will see a blank screen. b. Go to https://nobt.io/yIGHL7SzDSrJ/balances and navigate to "Blair". Everything works.

This seems to have to do with our routing and monomorphization of the makeGetBalance function that we use to retrieve the balance of a particular user from the redux store. This issue should be fixable once we completely move away from redux, however, this requires some more work with transitioning to fully utilize React's new hooks.