In 1994, parliament passed the Criminal Justice and Public Order Act, which gave special powers to the police to shut down the many free, illegal parties that had sprung up in abandoned government buildings, disused industrial spaces and the fields beyond the M25 since the emergence of acid house in the 1980s. In case of any doubt that this legislation was intended to target electronic dance music specifically, Section 63 of the act defines the soundtrack of these “raves” as “predominantly characterised” by “a succession of repetitive beats”.

There was widespread objection from the scene. The electro duo Autechre released the track “Flutter”, which attempted to subvert the law with a deliberately off-kilter rhythm. (The sleevenotes recommended that DJs keep “a lawyer and a musicologist present” to fend off “police harassment”.)

Yet the act wasn’t all bad. Organised crime, faulty equipment and blocked toilets were frequent features of the free party scene. The new law drove ravers into regulated nightclubs – not free, but designed for partying – where first aid, security, tap water and air-conditioning guaranteed smooth passage of the night.

In this context, the decision by Islington Council in September to revoke the licence held by Fabric, the nightclub in Farringdon, central London, was all the more confusing. In 2015, a district judge referred to the club as “a beacon of best practice”. But after two teenagers died there this summer, having entered the club with drugs hidden in their socks and underwear, it was concluded that “a culture of drug use exists . . . which the existing management and security appear incapable of controlling”.

When thinking about clubs and drug policy, it is important to remember one thing: the British government has been no more successful in stopping people taking drugs than the Catholic Church has been in stopping people having sex. According to this year’s Global Drug Survey, use of cocaine and MDMA (the chemical name of Ecstasy) is rising in Britain. People will always drink, snort or smoke things to feel good. The problem is, when buying in an unregulated market, nobody knows what they are taking. Almost 45 per cent of Britain’s clubs have closed since 2005. Recreational drug use is being pushed back to the periphery.

“There’s been a stratospheric rise in illegal events over the last few years,” says Nick Bell, who organises legal techno parties under the label Avant Garde. “I have a friend who runs illegal events for 1,500 or so people per month – in warehouses, forests and parks. Interestingly, the police tend to let them run. The events have a full security team, paramedics, a bar . . . The police don’t have the resources to shut down an event like that.”

On Monday, Islington and the Fabric team announced that the club would reopen, provided new measures such as an “ID scanning system” and “covert surveillance” were implemented. Absent from the list was anonymous substance testing, an idea already saving lives in Switzerland, the Netherlands and Portugal.

“UK drugs policy is increasingly focused on an abstinence-based recovery agenda,” says Fiona Measham, a government adviser and professor of criminology at Durham University, who gave evidence at Fabric’s licence review. “We tend to wait until people are addicted and injecting before doing anything.”

In 2014, the Loop, a charity that Measham co-founded, purchased a £25,000 laser capable of identifying any substance in 60 seconds. Volunteer chemists were present at three UK festivals this year; they also work with the Warehouse Project in Manchester, sending out alerts to patrons when dangerously pure or toxic substances are found to be in circulation.

“We’re not trying to encourage drug use. We’re trying to reduce harm,” Measham tells me. “The police have been at the forefront of this. They have limited budgets and can’t run around arresting everyone. The opposition has been from local councils and, bizarrely, public health.”

Measham believes that city-centre testing kiosks are the logical next step: available to anyone, no questions asked, between 6pm and 9pm. These kiosks would remove the stigma attached to clubs that might have well-meaning safety precautions used as evidence against them.

“The UK mentality was bred over years of licence restrictions,” Bell says. “We don’t use 24-hour licensing well. People think, ‘We’ve only got three hours in this place,’ so they consume as much alcohol or whatever as possible.”

London is going in the opposite direction from the rest of the UK. Manchester City Council, for instance, hopes to capitalise on its alternative “night-time economy”, while London seems content to promote commerce and tourism instead. This presents a rare opportunity for the regions. Because of the high value of land in London – clubs are often lacking in space for patrons to sit down, which forces them to remain on a hot dance floor all night – councils would sooner have them closed.

In 2015 an 18-year-old called Christian Pay died at the Kendal Calling festival in Cumbria after taking what he believed to be MDMA. “Nobody wants to deal with a death at a festival or in a club,” Measham says. “It hits everybody hard.”

This year, the Loop was drafted in to offer on-site drug testing. Expecting outrage, journalists doorstepped Pay’s mother at home. “She was really supportive,” Measham told me. “She said if they’d had it the year before, her son might still be here.”