Been involved twice (well, one and a half):
- Flight from ORD-SMF diverted to COS (Colorado Springs) to refuel. This was an old 737-200 on a day with brutal headwinds; announced prior to boarding.
- Wife and kids going SMF-ORD recently were supposed to divert to DEN because lavs hadn't been serviced properly (very late arriving plane the night before). Announced before boarding, and flight trackers showed the diversion plan. However, the flight continued on and landed in ORD -- I suspect this was a technicality of how far they could plan to fly from the ground, then once in the air with some lavs still operable they could get permission to go a bit farther.
Ironically, no compensation for the first (this was in the late 90s), nor did I expect it, but the travelers got choice of a $75 voucher or some miles for the 2nd, when they weren't actually impacted in the end -- except for my 5yo, who was upset that he didn't get 5 hours at the ORD play area as "promised" because they were going to misconnect
No extra miles for either based on actual routing...