Skip to content

fix for error "read property 'convs' of undefined" when a user has no conversations

chandi requested to merge fix-no-conversation-error into master

fixes https://sentry.io/foodsaving-worldwide/foodsharingde-production-front/issues/652397169/

What does this MR do?

there's the wrapper which translates the old xhrapp.php?app=msg&m=loadconvlist response into a new format, as a preparation for an upcoming API method. So that new written frontend code doesn't have to deal with the legacy data format.

In this code there is the line

if(!res.data.convs) return []

which throws an error for an empty response, which occurs when the user wasn't participating in any discussion yet.

How confident are you it won't break things if deployed?

pretty

Links to related issues

Checklist

  • added a test, or explain why one is not needed/possible...
    -> the wrapper will hopefully be gone soon anyway
  • no unrelated changes
  • asked someone for a code review
  • joined #foodsharing-beta channel at https://slackin.yunity.org
  • added an entry to CHANGELOG.md (description, merge request link, username(s))

Merge request reports