SLOPPY security at an American military base in Iraq in 2009 allowed a lowly soldier to set off a diplomatic thunderstorm. Bradley Manning, a junior intelligence analyst, downloaded a database of American government files onto a CD (labelled “Lady Gaga” to avoid suspicion) and uploaded them to WikiLeaks, a website devoted to exposing official wrongdoing.

The results were explosive and the price was heavy. The hundreds of thousands of leaked documents included a video of a shocking American airstrike on innocent Iraqis, carelessly mistaken for terrorists. A caustic ambassadorial cable describing the sybaritic lifestyle of the Tunisian presidential family may have sparked the Arab Spring.

In truth, though, the leaked cables mostly exposed nothing more than mild hypocrisy and buried literary talents. But they also endangered diplomats’ sources. In some countries—China and Zimbabwe, for example—candid discussions with American officials are regarded as tantamount to treason; there and elsewhere retribution duly followed. So too did costly and secret State Department efforts to protect, where possible, people who had mistakenly trusted America’s ability to keep a conversation private.

Speedily arrested after leaving clues in an online conversation, the soldier was jailed for 35 years on 22 charges, including espionage. Fans decried persecution of a brave whistle-blower, and what seemed vindictively harsh treatment, including nearly a year of solitary confinement.

The cause gained added weight when, the day after being sentenced, the convict switched name and sex: something that would have led to an immediate discharge from the army in any other circumstances. The authorities allowed her to take hormone-replacement therapy, but not to grow her hair. Chelsea Manning, now aged 29, was the most prominent name on a list of presidential pardons and commutations, most of which involved those serving long terms for drug offences, issued by Barack Obama in the final hours of his presidency. Her sentence will now end in May, after almost seven years behind bars. Others are furious. Senator Tom Cotton, a former army officer, said “We ought not treat a traitor like a martyr.” His colleague Lindsey Graham, an air-force veteran, tweeted that Ms Manning had “stabbed fellow service members in the back”. John McCain said the decision “devalues the courage of real whistle-blowers”. Such critics argue that Ms Manning ignored whistle-blowing criteria, such as trying internal channels first, and matching leaks with the purported wrongdoing. The move also casts a spotlight on two other cases. One is WikiLeaks’ founder, Julian Assange, holed up since 2012 in the Ecuadorean embassy in London to avoid questioning in a Swedish sexual-assault case. WikiLeaks had said he would be willing to face trial in America for leaking secrets if Ms Manning was pardoned. Mr Assange says he will stand by that position.

The other is Edward Snowden, an intelligence contractor who fled to Russia in 2013. Officials dismissed any talk of forgiveness for him, saying that the damage he had done was far graver, and that Ms Manning had already served a sufficient sentence. Mr Obama said that “justice had been served”.

Despite his clemency splurge, Mr Obama has been mostly regarded as rather harsh on whistle-blowers. Few expect Mr Trump to be lenient either.