The X-ray Integral Field Unit (X-IFU) will operate an array of more than 3000 Transition Edge Sensor pixels at 90 mK with an unprecedented energy resolution of 2.5 eV at 7 keV. In space, primary cosmic rays and secondary particles produced in the instrument structure will continuously deposit energy on the detector wafer and induce fluctuations on the pixels’ thermal bath. We have investigated through simulations of the X-IFU readout chain how these fluctuations eventually influence the energy measurement of X-ray photons. Realistic timelines of thermal bath fluctuations at different positions in the array are generated as a function of a thermal model and the expected distribution of the deposited energy of the charged particles. These are then used to model the TES response to these thermal perturbations and their influence on the onboard energy reconstruction process. Overall, we show that with adequate heatsinking, the main energy resolution degradation effect remains minimal and within the associated resolution allocation of 0.2 eV. We further study how a dedicated triggering algorithm could be put in place to flag the rarer large thermal events.