I believe international law or some international agreement calls for much more advanced notice.
If Russia, China, Iran, etc., did that to us you would be up in arms, correct?
Why, no.
If we were operating in a war zone (i.e. close enough to the action for SAMs to get to us) then we assume the risk of taking a hit.
I am unaware of any international agreements for a party in a conflict to telegraph their punches to anyone.