Marginal short-period contact binaries are important to understand as they pose a different physical scenario than the predicted theoretical model based on the thermal relaxation oscillation mechanism due to their shallow degree of contact. Here we present the optical and X-ray studies of a contact binary source RW Dor using the Transiting Exoplanet Survey Satellite (TESS) and XMM-Newton telescopes. For the first time we report the varying O’Connell effect and explain the asymmetry with a spot model. Based on the new times of minima, we make a robust estimate of the orbital period of the third body at 47.01 ∼ 0.52 yr with an eccentricity e = 0.21. We show that the period-decreasing trend observed in O − C variation can be explained by both conservative mass transfer from primary to secondary and AML via stellar wind. The X-ray luminosity exhibited by RW Dor did not vary significantly on three different occasions and was found to be about 3.34 × 1029 erg s−1. Assuming that the quiescent X-ray emission is emitted from an undisturbed loop structure, the loop size is estimated to be 0.6–1 × 1010 cm which is ≤Alfvén radius r A ∼ 8 × 1010 cm.