Now that we have both isInvalidSidebarSource and isInvalidPinSource, it makes sense to make the checks in fetchDerivedMessages more specific. Rather than simply filtering out message types generically, we'll handle it more specifically with 1) checking the message type and 2) calling either isInvalidSidebarSource or isInvalidPinSource accordingly.
Once again, there's a FlowFixMe for the same reason as in D9537 -- Flow doesn't refine the types if I don't explicitly invariant on all of the unexpected message types, and that list can either get long or just generally defeats the purpose of moving the logic into message specs to have one single source of truth.
Depends on D9537
I think the wording here may be a bit confusing. In my experience, 'cancel' typically means close the alert, and there's another option like 'confirm' or something that will mean you're ok with discarding changes.
Here it seems like 'cancel' means we're ok with discarding changes. Not sure if it's just me though (cc @ted)