This has not been the easiest of summers for Xi Jinping and his country. Donald Trump’s tariffs have rattled nerves in Beijing, already unsettled by the slowing economy. The ministry of finance and the central bank have had an open spat over fiscal policy. There are grumblings that the leadership invited trouble with its unabashed projection of might; was too complacent about the risks of US trade action; and is struggling to respond. But even if trade talks make progress when they resume this week, the issue is a channel for frustrations as well as the proximate cause.

The scrapping of presidential term limits this spring cemented Mr Xi’s extraordinary concentration of power. Yet in doing so it shocked and alienated even some sympathisers. Now there are signs of a pushback: gossip about political intrigue; a scathing essay from a well-known scholar. Meanwhile, a public health scandal over faulty vaccines given to children has undercut his drive to crush corruption and bring the bureaucracy into line: wasn’t it supposed to prevent things like this? The excitement engendered by these developments is in large part a sign of how rare any glimpse of disharmony has become. No one doubts that Mr Xi remains in control. The question is whether he will retain the same leeway in pursuing his course as his nation enters choppier waters. Less than a year ago, Mr Xi spoke of a new era which would see China moving “closer to centre stage and making greater contributions to mankind”, in a decisive break with the long-held maxim that the country should hide its light and bide its time. Now state newspapers warn of the dangers of hubris.

Underlying the tariffs is the growing hostility to China across the American political class. Beijing is correct to detect Washington’s anxiety in the face of its economic, technological and military progress. But the strength and breadth of concern is prompted by China’s increasingly repressive turn at home, and forcefulness abroad. Mr Trump’s erraticism, bullying and ignorance and the US disengagement he pursues have given Beijing a unique opportunity to make friends and influence people. Yet Australia, so dependent on China economically, has sounded the alert about “sharp power” and covert influence operations. Last month, Germany effectively blocked China’s state grid from taking a majority stake in an electricity network, citing national security concerns.

In Singapore, there are increasingly obvious nerves about China’s influence. Malaysia has suspended $23bn in Beijing-backed infrastructure projects. Thailand has announced the launch of a regional infrastructure fund, seen as an attempt to reduce reliance on Chinese investment. Countries are taking a hard look at their relationship with Beijing, and the true cost of attractive deals. The ambitious rhetoric has backfired – but even if it is scaled down, what really worries people are deeds not words. These range from established issues such as hacking and trade practices to the militarisation of the South China Sea and Sri Lanka’s debt-necessitated 99-year lease of Hambantota port to the Chinese state-owned corporation which built it.

The claim that the world, or at least the west, “got China wrong” is not quite right; more accurately, governments and businesses were often too hungry to do their due diligence, or to act upon the warnings they did receive. In any case, in the age of Mr Trump, climate change and a globalised economy, working with China is not a choice, but a necessity. This trade war is not a solution to the problems. What is needed is not more hostility, but more attention: a serious investment (not least linguistic) in truly understanding what China seeks and how it tries to achieve it. It means more nuance and sophistication, not less. It means recognising that it is normal for rising powers to seek to reshape rules, but determining what concrete problems this poses in light of its priorities and values – and how to address them. It means, for instance, closely examining Beijing’s systematic efforts to enlist the Chinese diaspora in its foreign influence work, without overreacting to public diplomacy, or scapegoating or stereotyping communities.

It means, too, consistency: not least a real commitment to working with those who share similar values instead of selling each other out for short-term advantage. Needless to say this will be a particular challenge for Britain in the age of Brexit. It means understanding that rights and values are not a bolt-on or a luxury for better times, but must be fundamental to the relationship. It means bolstering institutions that defend them, and upholding standards through our behaviour as well as our statements. None of this is easy. But it is necessary when the alternatives are drift and wishful thinking on one hand, or kneejerk hawkishness on the other.