Days after buying over-the-counter medicine from a pharmacy in Beijing, university student Yu was stunned to find her prized green health code -- the essential rating needed to enter the city's shops, offices and public transport -- was gone.

In a scene being repeated across the Chinese capital, a pop-up window now warned the app could no longer ascertain her coronavirus risk status.

School was out for Chinese New Year, so accessing classrooms was not a problem. Getting her bubble tea fix, however, was another matter.

"I'm not buying enough tea to meet the minimum for delivery, but the milk tea shop won't let me in without a health code," she lamented on the Twitter-like Weibo social media platform.

Across China, scanning a "green" health code app is a must for entering shops, offices and public transport
Across China, scanning a "green" health code app is a must for entering shops, offices and public transport AFP / Jade Gao

Yu was one of thousands who showed up to Beijing workplaces or shopping malls this week only to find they were barred entry due to their health code status, as already-strict virus controls were ramped up ahead of the Winter Olympics.

Overnight, the city had quietly rolled out a new rule requiring everyone who had bought medication for anything that might be a Covid symptom -- including fever, cough and throat dryness -- to take a virus test before their health app status could be restored to green.

But this was not simply a tech hiccup.

China -- where the coronavirus first emerged in late 2019 -- is one of the last places in the world sticking to a zero-tolerance policy in which the slightest hint of an outbreak is met by mass testing and strict quarantines.

Russian Olympic team members scan their QR health code after arriving at Beijing Capital International Airport
Russian Olympic team members scan their QR health code after arriving at Beijing Capital International Airport AFP / Kirill KUDRYAVTSEV

The health codes, with their colour-coded system of red, yellow and green signifying different levels of Covid risk, have been a crucial pillar of this system.

Health-tracking apps are now required for entry almost everywhere, including offices, transport stations, stores, malls and taxis.

Without it, normal life grinds to a halt.

The health code app in northern China's Xi'an crashed after a mass testing order in December
The health code app in northern China's Xi'an crashed after a mass testing order in December AFP / STR

As complaints like Yu's piled up on social media, the Weibo hashtag "Beijing Health Kit Pop-up" gained more than a million views.

"I can't go out to eat, or buy a coffee -- it's so annoying," fumed one of many hit by the change.

The "pop-up" drama highlighted the country's dependence on the health code system, which debuted in 2020, just a few months into the pandemic.

Coronavirus controls in Beijing have been ramped up ahead of the February Winter Olympics
Coronavirus controls in Beijing have been ramped up ahead of the February Winter Olympics AFP / Kirill KUDRYAVTSEV

While the apps are technically not mandatory, it is effectively impossible to move around China without one.

Beijing's app is one of dozens of local health-monitoring programmes that use geolocation and health screening data to track users' movements and assess whether they have been near people with the virus.

It also records vaccination status and coronavirus test results.

Some apps are so sensitive they can detect specific districts visited and block users from accessing transport if they have been to communities ranked as high risk.

At least one criminal has been apprehended after having to submit data to the app, according to state media.

Reportedly on the run for decades, he gave himself up because he could no longer enter stores or find jobs without the code.

The health codes' rollout was initially met with some privacy concerns -- but those were quickly steamrolled as China began to tout its handling of the pandemic as a success story in contrast with the chaos abroad.

Now, those travelling between provinces often have to download multiple local versions of the app -- as well as a national version linked to their phone numbers -- and show green codes on all apps when arriving at their destinations.

Many offices, restaurants and transport stations require visitors to open up the app and scan location-specific QR codes to "check in" before entering.

The system's ubiquity, while useful for officials seeking to track coronavirus contacts, has also proven to be one of its main weaknesses.

Residents in the western city of Xi'an complained in December of a systemwide crash on their local health code app after authorities suddenly ordered mass testing of millions of inhabitants over a spike in coronavirus cases.

The order prompted residents to flock to Covid-19 testing centres, overwhelming the health code system.

Local media reported hours-long lines of people trying to enter subway stations as well as a second system crash in January after the city had been placed under strict lockdown.

The city official in charge of the technology was swiftly fired.