Remember the trading slogan, "buy the rumor, sell the news." If I remember correctly, gold actually surged in the days when US-Iran tensions escalated. Once the war actually broke out, major traders were already in profitable positions. However, the real safe haven from this war is energy commodities, as the effects of scarcity are truly felt worldwide. Capital inflows into the gold market will be limited, with most going to the oil market.
This is true, the rise in gold does not occur when the war has occurred but before that where the media continues to talk about the potential for war or just rumors and that's where the new smart traders and investors come in because most of them take the rumors not the day of the war therefore gold does not rise when Iran's attack on US bases and also on Israel on a large scale has no impact on the price of gold.
Oil has always been an important commodity in wars especially now that it is related to global oil, it will definitely increase in price.
I read the news a few days ago that Iran could push oil prices to $200 dollars per barrel he said if many intervene in this war.