The regime is acutely aware that there are many parallels between the Russian-Ukrainian relationship and the Chinese-Taiwanese one, and that the Russian attempt to conquer Ukraine is failing, or at least stalled.

It’s only recently that Russia’s President Vladimir Putin began denying that Ukraine is a real nation, but that has been Beijing’s position with regard to Taiwan from the start. From Mao Zedong to Xi Jinping, every Chinese leader has warned, implicitly or in just so many words, that if Taiwan declares independence from China it will be invaded.

For 73 years, ever since the Nationalist regime lost the Chinese civil war in 1949 and retreated to Taiwan, it has been the risk of a war with the United States that has deterred the victorious Chinese Communists from invading the island and finishing the job. But that threat may be a paper tiger, for there is no actual alliance between Taiwan and the United States.

Like Ukraine, Taiwan gets many expressions of sympathy and support from Washington, and even fairly advanced weapons (although Taiwan has to pay for them), but it does not have a promise that the US Navy will stop a Chinese attack across the Strait of Taiwan, or indeed that the United States would use force in any way to defend Taiwan.

While the chaotic US withdrawal from Afghanistan was still underway last August, US President Joe Biden, seeking to reassure various friends and allies, said “We made a sacred commitment...that if anyone were to invade or take action against our NATO allies, we would respond. Same with Japan, same with South Korea, same with – Taiwan.”

That cheered many people in Taiwan – but later in the same day a senior American official, speaking ‘not for attribution’, said that “US policy has not changed.” The real US policy is still ‘strategic ambiguity’, which is a policy designed to keep China worried while leaving the United States free to help Taiwan or not as the mood of the moment dictates.

The United States didn’t even bother with ambiguity in the case of Ukraine, making it clear from the start that it would not offer any military resistance to a Russian conquest of Ukraine. This is perfectly sensible when your potential adversary has nuclear weapons – but China does too, so the lesson for Beijing is that the US won’t really fight for Taiwan either.

That is certainly the conclusion that President Tsai Ing-wen’s government in Taipei will draw from recent events, so she will be shopping urgently for state-of-the-art weapons to defend Taiwan with. Given the current mood in the US Congress, she will probably be able to get them.

Yet it’s unlikely that Xi Jinping’s advisers will be urging him to seize this moment to attack Taiwan, because what he sees in Russia is a brother autocrat, Vladimir Putin, who took a similar gamble and is facing a humiliating defeat. Putin’s miscalculation has been so monumental that he may even lose power over it.

There are two elements in Putin’s catastrophe that Xi will suspect might also apply to any attempt by him to seize Taiwan by force. The first is just that his inexperienced armed forces, ordered to carry out an amphibious invasion of Taiwan, one of the most complex military operations in the book, may prove to be, like the Russians, simply not up to the task.

He’s probably wrong about that. The Russian army is embarrassingly incompetent because, like virtually every institution in Putin’s Russia, it is riddled with corruption. Xi has been on anti-corruption crusade since he took office a decade ago, so it’s probably not so bad in China. But he can’t be sure of that until he places his bet, and then it might be too late.

The other thing Xi can’t be sure of is what kind of sanctions China might face if it invaded Taiwan. Would China’s best customers, the developed nations that have shown such unity and determination in imposing unprecedented sanctions on Russia for invading Ukraine, do the same to him if he invaded Taiwan?

Nobody knows, including the players themselves, but China is hugely exposed to any interruption of international trade, and domestic circumstances are not propitious either. Everybody is sick and tired after two years of Covid lockdowns, and the economy is not booming like it used to.

There would certainly be a surge of patriotic enthusiasm if Xi ordered the invasion of Taiwan this year, but he should wait a bit and watch what happens to another dictator who launched a stupid, unwinnable war and got his whole country cancelled.