The Flow update forced me to type MessageSQLResultRow here, which surfaced some issues. Separating this diff out since there are some non-Flow changes:
- Added an invariant that should never trigger: collapseQuery results should all have collapse_key.
- Added an if (!row.id) continue to parseMessageSQLResult. This is necessary because technically id is nullable – in fetchCollapsableNotifs, if a notif points to a message that is missing in the messages table, this can happen. In that case we will just skip that message when fetching the collapsable notifs.
- Stripped some awaits that were in front of parseMessageSQLResult (which doesn't return a Promise).
Depends on D9864