If a spell caster loses concentration on greater invisibility, and an opponent has readied a reaction, what happens first?


As an example, both the spellcaster and the opponent (“the archer”) have 1 hp remaining, so whoever completes there action first will knock the opponent unconscious. The spellcaster casts Create Bonfire, On the archer’s space. However, The archer has readied an arrow targeting the spellcaster for “as soon as the spellcaster is visible.”

My question is, who’s action will go off first?

The relevant information on concentration can be found in the PHB (p.203):

You lose concentration when you cast another spell that requires concentration. You can’t concentrate on two spells at once.

and XGtE (p.5):

As soon as you start casting a spell or using a special ability that requires concentration, your concentration on another effect ends instantly.

Readied actions can be seen in the PHB (p.193):

When the trigger occurs, you can either take your reaction right after the trigger finishes or ignore the trigger. Remember that you can take only one reaction per round.

From this, it seems unclear who will complete there action first. What counts as the archer’s trigger finishing? does it finish when the spellcaster finishes casting their spell, as this action is what began the trigger? Or does the archer get to fire their arrow as soon as the spellcaster is visible, as they “finish” being invisible as soon as they begin casting the second spell?