For many years foreign companies operating in China have faced social media-fuelled consumer backlashes, sometimes over instances of cultural insensitivity and sometimes over political controversies.
"Anyone who offends the Chinese people should prepare to pay the price," was the blunt message from China's Foreign Ministry Spokeswoman Hua Chunying when asked recently about a number of Western companies facing a boycott after they expressed concern over alleged human rights abuses in Xinjiang province.
H&M was the main target, but the backlash also hit Nike, Adidas and Puma - all members of the Better Cotton Initiative (BCI), a non-profit group promoting sustainable cotton production.
The Swedish fashion retailer is blocked on China's major ecommerce platforms and their physical stores have vanished from some digital maps. Twenty H&M stores remain closed.
These companies aren't the first to face a backlash in China and almost certainly won't be the last.
But the price of these transgressions seems to vary dramatically. The trouble blows over quickly for some companies, but causes lasting damage for others.
The President of the EU chamber of Commerce in China Jeorg Wuttke said it was not uncommon for foreign companies to run afoul of Chinese sensibilities. It's a longstanding challenge, and one that has grown with China's economic importance and Europe's changing attitudes.
"What has changed is that public perception and public opinion on China has dramatically soured. And that, of course, increases the heat on companies on the home front," Mr Wuttke said.
For some retailers like H&M, it's a conundrum. Should they stick to their principles and risk of their business in China, or relent and offend their customers elsewhere?
At the moment, H&M sells 94.8% of its clothing elsewhere, but China's growing wealth is likely to represent a large portion of the company's growth in the coming years.
Mr Wuttke thinks the goal appears to be to inflict short-term pain to make a political point rather than to put companies out of business.
The boycotts are selective and most often target companies with a high-visibility retail presence, an approach which maximises the visibility of the backlash but also minimises the impact on China's economy.
It's fairly easy for a retailer to ramp up their operations again, but the same might not be true for businesses in other sectors, such as heavy industry.
"If they were to punish a chemical company, or a company that produces machinery, these guys have assets on the ground. If they walk away, they will not come back," he said.
Cultural missteps or political statements?
There are a variety of ways that foreign businesses can run into trouble with Chinese consumers. Many have fallen foul of them for being culturally insensitive.
Often these controversies blow over, and consumers come back. Balenciaga and Burberry, for example, both offended consumers with clumsy ad campaigns related to Chinese holidays.
"There are now a sufficient number of instances to suggest cultural missteps can be healed through thoughtful on-the-ground execution and the passage of time," said Michael Norris from consumer research business AgencyChina.
Even so, both companies have run into trouble over other issues as well. And sometimes cultural missteps can also be more serious.
Italian luxury brand Dolce & Gabbana felt the wrath of Chinese social media when it released three videos in 2018 showing a Chinese model struggling to eat Italian food including cannoli and pizza with chopsticks.
The ad was widely seen as racist, and it led to a backlash with several Chinese retailers pulling the brand's products.
The company's results since then suggest it may have had an effect, with the Asia Pacific market falling from 25% to 22% of the group's total turnover for the year ending in March 2019 (even though the company's revenues overall grew 4.9% to $1.54bn).
The following year, the company's wholesale and retail takings in Asia, including China and Hong Kong, were down 35%. However, the results made no mention of the boycott and the period in question includes the first three months of 2020, when China's economy was hit by the Covid-19 pandemic.
Foul or free throw?
Politics, on the other hand, presents an entirely different challenge.
In 2019, the US National Basketball Association suffered what its chief executive described as "substantial" losses after an online comment from a team executive prompted a backlash in China.
"Political stances or commentary can jeopardise a brand's future in China," said Mr Norris.
After the Houston Rockets' manager Daryl Morey tweeted support for pro-democracy protesters in Hong Kong, the state-run broadcaster CCTV and Tencent Holdings, which streams NBA games in China, said they would stop broadcasting Rockets' matches.
The Chinese Basketball Association suspended co-operation with the Houston Rockets, as did Chinese sportswear brand Li-Ning, and the club's sponsor in China, Shanghai Pudong Development Bank.
The Rockets remain benched.
"It took the better part of an NBA season to reinstate the Houston Rockets box-score and ranking to Tencent Sports. However, to this day, Houston Rockets apparel remains unsearchable on Alibaba's e-commerce marketplaces," Mr Norris said.
A Lotte of money
Korean companies faced perhaps the fiercest opposition in 2017, when South Korea agreed to install a US missile system which Beijing said could be used to spy on China, even though it was intended to defend against North Korea.
The Korea Tourism Organization estimated the spat cost the country's tourism operators $6.5bn (£4.66bn) in lost revenue. Korea's cosmetics and entertainment industries took a hit too. The central bank estimated that it knocked 0.4% off the country's economic growth for the year.
Perhaps the biggest loser was Korean conglomerate Lotte, which provided land it owned in South Korea for the missile defence system.
The company sold off its chain of convenience stores to a Chinese company as a result of the controversy.
The suffered losses of around $1.7bn in China in the 18 months after the controversy erupted, mostly from selling off its convenience stores in China at a loss, according to the Financial Times.
The company's confectionery, beverage, food production and department store divisions all took a hit.
However, even Lotte has returned. In 2019 the company resumed work on a $2.6bn real estate project in Shenyang.
Mr Wuttke says it rarely seems to be the case that foreign businesses are excluded from China permanently. The key question seems to be how long the boycotts last.
"China wants the world to know about its anger. They do so. It's very painful for companies, but it blows over," he said.