Opacity mask not behaving as expected for object that crosses over itself
When I make a gradient opacity mask for a line object as shown, the opacity mask behaves as expected when the object overlaps another object (cyan rectangle; i.e. you can see the bottom object through the top object), but does not when it overlaps itself (magenta rectangle; i.e. the part of the object on the bottom is clipped by the shape of the object, rather than visible through the opacity mask like the separate object).

-
Oh, found it too late!
It’s not a bug really, as I see it.
The path that is inside of the opacity mask has a gradient applied across its stroke. The gradient is black-white-black, its stops don’t have their own opacity changed. Even if it was tranparent-white to white to transparent-white — the opacity is calculated on the object level, and the self-intersection happens before the styling.
To achieve the thing you want you’d have to cut this path inside of the opacity mask and set both parts to Screen blending mode (again, inside the mask).
Not sure though the final result is something that would please you... it’d require cutting the main path as well...
So I see the problem, and I agree it can be better handled. Turning this entry into a feature request.