An already head-spinning legal case between Facebook and the developer of a now-defunct app that searched for Facebook users' bathing suit photos took another series of turns Wednesday. First, The Wall Street Journal reported on a previously redacted court filing, containing information that Facebook has fought for months to keep sealed, which alleges that Facebook had considered selling access to user data before 2014. Then, Facebook hit back against the company behind the lawsuit---Six4Three---arguing that it breached a court order to keep the documents sealed and then sought to destroy evidence just before British lawmakers seized some of those documents from Six4Three's founder last week.

The court filing, which was drafted by Six4Three's legal team in 2017, is based on internal Facebook documents obtained through discovery. Though the underlying documents aren’t included in the filing, they’re partially quoted throughout it and suggest that Facebook brokered special data deals with companies like the Royal Bank of Canada and Amazon, among others. In one email cited in the filing, a Facebook employee discussed shutting down apps that don't spend "at least $250k a year to maintain access to the data.” The exposure of this sensitive information comes down to a simple technical glitch: The court documents were redacted improperly, leaving the underlying text exposed when it was uploaded to a text editor by a reporter at Ars Technica, which published the document in full Wednesday night.

"The documents Six4Three gathered for this baseless case are only part of the story and are presented in a way that is very misleading without additional context," said Konstantinos Papamiltiadis, Facebook's director of developer platforms and programs, in a statement.

The company had successfully fought to keep the documents sealed in California, where the lawsuit was filed. But last week, lawmakers in the United Kingdom seized at least some of them from Six4Three founder Ted Kramer while he was traveling to London on business and are planning on publishing them within a week. Facebook is now charging Six4Three with breaching the California court order and is demanding a discovery process of its own to find out how British regulators were able to obtain confidential documents that were never supposed to see the light of day.

The filing cuts to the heart of an increasingly nasty legal battle between Facebook and Six4Three, whose bikini-finder app Pikinis went out of business in 2015 after Facebook changed its API to cut off app developers from their users’ friends data. It did this ostensibly to protect users' privacy. But the Pikinis app relied on that data, and after it shut down, Kramer sued Facebook, alleging that the company had been planning to cut off access to this data as early as 2012, at the same time it was luring new developers with it. He has since accused the company of trading access to user data in return for mobile advertising purchases from app developers beginning in 2012.

In a hearing in London this week, Facebook's vice president of public policy said that the company considered a variety of business models, including privatizing its APIs, as it transitioned from a primarily desktop-based business to mobile. But in a subsequent statement provided by Papamiltiadis, the company stood by its assertion that it's never sold data. "Our APIs have always been free of charge and we have never required developers to pay for using them, either directly or by buying advertising," he said.

It’s an international he-said/he-said showdown where somehow every party looks bad. Facebook appears to have at least seriously considered something it has long promised it would never do, which is sell users' data. Six4Three, meanwhile, is coming after Facebook for actually strengthening its protections of user data at a time when the world is rightly concerned about the lack of privacy online. The Pikinis app let people access strangers' bikini photos, using the same feature that enabled a political firm called Cambridge Analytica to misappropriate the data of tens of millions of Americans without their knowledge. Then there are the UK lawmakers who, in their quest to hold Facebook accountable, have defied international norms by seizing documents that were ordered sealed in the US, setting a worrisome precedent.