Skip to content

Prevent trying to display event updates which don't exist

Chris Oelmueller requested to merge bugfix-dashboard-leaking-events into master

Fixes a bug with dashboard updates (for event posts specifically) from !735 (merged)

What does this MR do?

When event invitations were displayed on the dashboard, there was a foodsaver relation that matches the DB query and so the dashboard would try and display updates... even if none exist

If status == 3 i.e. declined, the query would fail and no such updates would be displayed.

Out of paranoia to prevent similar incidents in the future, add the same check to two other updatequeries (fsp, status)

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

100% (it can only improve anything)

Links to related issues

!735 (merged)

How to test

  • Create event
  • Sign up for the event (yes or maybe)
  • DO NOT POST ANY UPDATE in the event
  • go to dashboard

should:

  • display the event invitation (above the update-list)
  • correctly display "no event updates" without showing errors in the browser console
  • when you write an update into the event, correctly display that on the dashboard too

Checklist

  • added a test, or explain why one is not needed/possible...
  • 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))
  • Once your MR has been merged, you are responsible to update the #foodsharing-beta Slack channel about what has been changed here. They will test your work in different browsers, roles or other settings
Edited by Chris Oelmueller

Merge request reports