Took down a ceiling fixture and discovered what looks like a possible switch loop, except I don’t understand how the connection gets completed with the current set up. Basically, 2 lines coming into the fixture box. The black from line A is wired to the fixture, and the white from line A is essentially “capped off” (is cut short and contained within the insulated portion of line A). The white from line B is wired to the fixture, and the black from line B is capped off. Over at the single pole switch there is a black wire and white wire attached. This would make sense to me as a switch loop if the 2 capped off wires were joined together, but they’re not.
The white and black should be used in every cable to prevent electromagnetic induction.
The only single conductor you should ever have in a residential electrical system is a ground wire.
You need to investigate this and correct it.
It looks to me there was a problem and someone just capped what they thought to be the hot. One cable should have the hot and neutral the other goes to the switch connect the hot to the white going to the switch the black coming back from the switch to the black of the light fixture, white to white and connect the grounds together. This was the code compliant way to wire switch legs a few years back, now the neutral has to go to the switch box but this dosent need to be updated for a repair or fixture replacement.