  Detecting and coherently characterizing thousands of gravitational-wave
signals is a core data-analysis challenge for the Laser Interferometer Space
Antenna (LISA). Transient artifacts, or "glitches", with disparate morphologies
are expected to be present in the data, potentially affecting the scientific
return of the mission. We present the first joint reconstruction of short-lived
astrophysical signals and noise artifacts. Our analysis is inspired by glitches
observed by the LISA Pathfinder mission, including both acceleration and fast
displacement transients. We perform full Bayesian inference using LISA
time-delay interferometric data and gravitational waveforms describing mergers
of massive black holes. We focus on a representative binary with a
detector-frame total mass of $6 \times 10^7 M_\odot$ at redshift $5$, yielding
a signal lasting $\sim 30~\mathrm{h}$ in the LISA sensitivity band. We explore
two glitch models of different flexibility, namely a fixed parametric family
and a shapelet decomposition. In the most challenging scenario, we report a
complete loss of the gravitational-wave signal if the glitch is ignored; more
modest glitches induce biases on the black-hole parameters. On the other hand,
a joint inference approach fully sanitizes the reconstruction of both the
astrophysical and the glitch signal. We also inject a variety of glitch
morphologies in isolation, without a superimposed gravitational signal, and
show we can identify the correct transient model. Our analysis is an important
stepping stone toward a realistic treatment of LISA data in the context of the
highly sought-after "global fit".
