I go with #1.
When you start to cast an attack spell the Invisibility drops. The spell does not have to be completed or do damage. It only needs an attack roll or a target for the invisibility to drop.
If the Invisible caster had made a melee attack and missed would he become visible?
Yes.
And as hong said “A readied action always goes before the triggering event” You don’t rationalize it, its game mechanics
When you start to cast an attack spell the Invisibility drops. The spell does not have to be completed or do damage. It only needs an attack roll or a target for the invisibility to drop.
If the Invisible caster had made a melee attack and missed would he become visible?
Yes.
And as hong said “A readied action always goes before the triggering event” You don’t rationalize it, its game mechanics