You can assume that restaurant operators in New York City, from the casual-dining Italian trattoria in Midtown to the bodega down the street, all agree on one thing: they want access to personalized customer data from third-party delivery providers.

They had high hopes after the city passed a law in 2021 that required providers to disclose such data. But their enthusiasm dimmed when the providers sued and the city held off on enforcement until a ruling was issued. And those dreams absolutely cratered this week after a U.S. district court judge ruled in favor of the providers.

The city had passed the law in an effort to assist restaurants reeling from the impact of the pandemic. But good intentions notwithstanding, Judge Analisa Torres ruled that the law, which would have forced providers to share customer names, addresses, and contact info, is unconstitutional, agreeing with the providers’ argument that the law violated the privacy of consumers and threatened their data security. She wrote in her ruling that the Customer Data Law was not an appropriate tool to enforce data sharing. She indicated that the city might better pursue its goals by offering financial incentives to providers to share data and developing an option for customers to decide whether to share their info.

DoorDash released a statement that the decision “rightly recognized how this law would have violated bedrock First Amendment rights of how we protect New Yorkers’ data.” Grubhub said it “reinforces the privacy protections that New Yorkers deserve.” Uber Eats has remained quiet.

These have been turbulent times for third-party delivery providers in the Big Apple. The city has identified the providers as a bogeyman it needs to regulate. It has previously passed delivery fee caps and new minimum wage standards for delivery drivers. The providers lost its appeal on the minimum wage and are awaiting a court date for its lawsuit on the fee caps.