Pls note the below.
8 attacks made but only 1 flag left.
The flag immediately vanishes after using, but the battle result will be sent after the fight.
If you lose connection during a battle, whatever (we/flag/gems) was needed to start it, will be gone and the battle itself will be counted as if it was worst case.
Somehow the game gave me my win since I finished the raid regardless of my connection.
During the submit results part, I was kicked out.
Fortunately the win was there and not forfeited.