Why do dihaloalkanes lose both halogen atoms during mass spectrometry? I was looking through mass spectrums of haloalkanes and found the one for 1,2-dibromobutane confusing:

The base peak is at 55 m/z, and the only fragment I can think of with that ration will be $\ce{C4H7+}$. The two bromine atoms must be absent as the relative molecular mass of one bromine atom is 80. I can't think of how this will happen. Does the removal of one bromine atom force the other off? Does it form an alkene? It is present in all positional isomers (1,3-dibromobutane, 1,4-dibromobutane etc.) I initially thought that the lone pair of the bromine will be donated to the positively charged carbon, but if the carbon is 2 carbons away from the bromine, I can't imagine this happening.
I feel like this is somehow related to the addition of bromine to alkenes, maybe the bromonium ion is an intermediate and bromine gas is formed? The chemical formula might be that of an butene radical. But since the peak still shows in the spectrum of 1,4-dibromobutane, I don't think that is the case.
If anyone has any theories, please do share!
It isn't just both bromine atoms that are lost, although that might be expected in mass spec given the relative weakness of the carbon-bromine bond.  You also lose a hydrogen atom.  And that is key.
We might suppose that a single bromide ion (or bromine atom plus electron) comes off first, forming a $\ce{C4H8Br^+}$ ion.  That is the peaks at 135 and 137, recalling that in mass spec the mass of a bromine atom is both 79 and 81 which are the most common isotopes.  There is nothing spectacular about such an ion per se, but now it can eliminate $\ce{HBr}$, or $\ce{H + Br}$ to give a resonance-stabilized cation:
$\ce{CH2=CH - \overset{+}{C}H - CH3}\leftrightarrow\ce{\overset{+}{C}H2 - CH=CH - CH3}$
Thus the formation of this ion is energetically favored, and it would account for $\ce{C4H7^+}$.
In the case of 1,4-dibromobutane you should expect the initial (primary) $\ce{C4H8Br^+}$ carbocation to rearrange with a hydride transfer to the end carbon that first lost the bromine, making the ion secondary.  Then the ion will match that obtained with the other isomers.