NEW YORK — The city's hottest primary election is the 12th Congressional District.

In one corner, you have Rep. Carolyn B. Maloney, a pal of House Speaker Nancy Pelosi’s who has been in Congress since 1993 and was recently elected chair of the House Oversight Committee. In the other is Suraj Patel, a former Obama campaign staffer and attorney who has never held public office and helped run his family’s business constructing and franchising hotels in the Midwest before moving to New York in 2006.

Their contest has everything. The Upper East Side. The Lower East Side. A tenacious, white, wealthy 74-year-old Democratic incumbent. A 36-year-old Indian American challenger who has taught at New York University’s business school and aims to be the state’s first South Asian representative in Congress. Just 648 in-person votes are separating them, with 65,000 mail-in ballots still being counted. And an entire district of 718,000 people across three boroughs have no idea who their next representative will be — a full month after Election Day.

“It’s been dysfunctional to the extreme,” said Brian Van Nieuwenhoven, treasurer of the Samuel J. Tilden Democratic Club in the district.

At the center of this mess is a massive influx of mail-in ballots — 403,000 returned ballots in the city this cycle vs. 23,000 that were returned and determined valid during the 2016 primary — and a system wholly unprepared to process them. It’s not just delayed results that are at issue: In the 12th District and in the primaries across the country, tens of thousands of mail-in ballots were invalidated for technicalities like a missing signature or a missing postmark on the envelope.

This isn’t the only primary race in New York still up in the air. The 15th Congressional District in the Bronx, where New York City Council member Ritchie Torres holds a healthy lead, still hasn’t been called. Two other primaries in the Bronx and Westchester, won by Jamaal Bowman and Mondaire Jones, were not decided for three weeks.

None of this bodes well for November’s federal election in which President Trump has refused to say whether he will accept the results. Turnout is expected to skyrocket because of the presidential race. Another coronavirus spike in the fall could lead to more mail-in ballots from people who fear crowded polling places. Add in slowed mail delivery because of the pandemic, while Trump constantly threatens to dismantle the U.S. Postal Service. Meanwhile, Trump and his Republican allies have repeatedly attacked the integrity of mail-in voting, making unfounded claims that the method is susceptible to widespread fraud.

Enter New York’s 12th as an extreme, but not isolated, case study. Last week, the race even caught the eye of White House press secretary Kayleigh McEnany, who cited “the absolute catastrophe for New York City” in her news briefing while answering a question on election security.

“It’s a dark omen for November,” said a Wall Street Journal op-ed about the race, warning against voter fraud.

Meanwhile, the actual humans stuck in the purgatory of the undecided election in the 12th District have almost become secondary characters to the D.R.A.M.A. unfurling around them.

Maloney and Patel’s electoral fates hang in the balance of those mail-in ballots. This is the only district in New York in which the absentees made up well over 50 percent of the vote, largely because it is one of the wealthiest districts in the city and so many residents fled to their second or third homes in the Hamptons or the Adirondacks.

Both NY-12 candidates estimate that around 20,000 out of 45,000 mail-in ballots have been counted in Manhattan so far. According to Patel’s campaign, he was up by 1,000 when the smaller portions of the district (but the larger percentage of invalid votes) in western Queens and northwestern Brooklyn finished tallying. But with Maloney’s base of the Upper East Side being counted, he’s down by 2,000. According to an email sent by Patel’s field director late Friday, the campaign is no longer sending staffers and volunteers to monitor the count in Manhattan. Unless something happened with the invalidated ballots in the race, the email read, “our path to victory becomes much narrower.” Patel’s spokeswoman, Cassie Moreno, said they had decided to stop going to the count because they felt it was slowing down the process and they would rather focus on efforts to get the invalidated ballots counted. “Our focus will shift this week to fighting for those invalidated ballots and working to make sure every single vote is counted, no matter who they were cast for,” she said.

Maloney, who provided a statement but declined to be interviewed for this article, called for patience. Her team had been at the counting sites every day, she said, while thanking the Board of Elections (BOE) for their hard work.

“While everyone wants the results to be certified, we can’t sacrifice accuracy for speed when it comes to something as critical as peoples’ vote,” she wrote.

But the invalidation rate is concerning to many who are watching the race. According to data from the BOE first published by the Intercept and Gothamist, up to 1 in 5 mail-in ballots were declared invalid before even being opened, based on mistakes with their exterior envelopes. The majority of mistakes are due to missing or late postmarks, and missing signatures. Preliminary numbers from the BOE show an invalidation rate of 19 percent in both Manhattan and Queens and 28 percent in Brooklyn, just in this district. That rate, if applied to all of Brooklyn, would equate to 34,000 ballots thrown out, in a borough with the city’s largest population of black residents.

By comparison, in Wisconsin and Georgia, two primaries considered to be chaotic, the mail-in ballot rejection rate was 1.8 and 3 percent, respectively.

On July 17, Patel joined a federal lawsuit along with State Assembly candidate Emily Gallagher (who just won her race) and more than a dozen voters charging Gov. Andrew M. Cuomo and the BOE with creating “an election law snafu.” Maloney is not part of the lawsuit, but she did sign a joint statement with Patel and the other two candidates in their race demanding that all votes be counted.

“Never in my wildest dreams did I think that after tripling the electorate turnout, we would then be fighting weeks later to just get our ballots counted,” Patel said. “It’s just a terrible canary in the coal mine for anyone looking at the November election.”

The candidates

This race is actually a rematch. Patel (who pronounces his first name like “surge”) challenged Maloney in 2018, and he got 40 percent of the vote by campaigning with then-candidate Alexandria Ocasio-Cortez and running as a progressive. It’s exactly the same percentage he got of the in-person vote this time, though with the pandemic and two democratic socialist candidates in the race, Patel decided to run more as an Obama-hope-and-change candidate to the left side of the middle.

Election Day was on June 23. The BOE, by law, waited a week for all the mail-in ballots to arrive, and then waited until July 8 to start the count because of the sheer volume of ballots to sort through and Fourth of July weekend. A week after that, no absentee ballots had been counted in the 12th District.

“I’ve waited three years for this result, so another three weeks isn’t that bad,” said Patel at the time.

But around the month mark, his chipper attitude started to wane. “Literally nothing is happening, and that’s in Brooklyn. Manhattan is even more of a disaster,” he said.

It’s sometimes hard to remember that these candidates had platforms and positions and that people like and dislike them, before their election turned into “Waiting for Godot.” Maloney is Upper East Side, through and through. It’s where she lived and where she stayed during the shutdown, holding Zoom town halls. She is known as a hard-charging feminist and a prolific author of legislation who has championed funding for rape kits and the permanent authorization of the 9/11 Victim Compensation Fund. She recently said that, as head of the Oversight Committee, she will shoot down “the Trump Administration’s craven attempt to add a citizen question to the Census.”

At a time of protests and pandemics, Patel’s main attacks on her were about her long record of “tough on crime” stances and that she is an anti-vaxxer, based on her repeated public queries about the link between vaccines and autism. Maloney has responded that both she and her children are vaccinated.

Patel, who lives with his ER doctor brother, got the coronavirus in March and has positioned himself as the pro-science candidate, even writing a universal testing plan. After his recovery, he could be seen at Black Lives Matter protests outside the mayor’s residence of Gracie Mansion in the district. He claims that once the shutdown happened, his campaign helped people set up unemployment claims, apply for small business loans, get toilet paper.

Maloney’s main knocks on him are calling into question his big campaign donations from the Midwest and that he is a creep with women. There’s even an ad her campaign approved on a website called nocreepsforcongress.com. He said that Maloney was vicious and that her campaign had misinterpreted a joke.

All the action in their contest is focused on the count, and it is something out of a dystopian thriller about office tedium. At the Manhattan canvassing spot, numbered folding tables are scattered throughout a cavernous space. Two BOE employees sit on one side of a plexiglass sneeze guard.

On the other side are the watchers. Each campaign gets one watcher at each table. The BOE employees open the envelopes and show the ballots through the sneeze guard so the watchers can contest a ballot’s validity and compile chicken-scratch tallies. The pace is equivalent to watching a sloth eat bark.

'We are constrained'

Back in his office, Patel is worrying over “the postmark issue.” It was all he could think about: the 13,000 invalid ballots across three boroughs in his race. Based on photocopies of envelopes his campaign received from the BOE, he estimated half of those were not counted because of a missing postmark.

These are ballots that fell into a kind of black hole of election law. Ballots that arrived to the BOE before or on June 23, Election Day, with or without a postmark are valid. Ballots that arrived by the cutoff of June 30 with a postmark of June 23 or earlier are valid. Ballots that arrived before June 30 but have no postmark or a postmark of the 24th, which many had, likely due to what the BOE called “USPS error,” Patel said — those are invalid, automatically.

“It’s a question of timeliness. We are constrained,” said Valerie Vazquez-Diaz, the BOE’s spokeswoman.

That third category of ballots has the ones Patel is fighting to have counted. The lawsuit he filed calls on Cuomo to fix the issue with an executive order.

In his Tuesday news conference, Cuomo punted the issue to the state legislature.

What Patel argues is that the law isn’t taking into account how much the pandemic changed the election. In the midst of the state’s shutdown in April, Cuomo signed an executive order mandating that the BOE send an absentee ballot application to every New Yorker, who in the past could only obtain an absentee ballot for narrow reasons, such as illness or disability.

The BOE, with limited staff allowed in its offices, sprung to action, setting up an online portal and a phone line for absentee ballot requests and preparing a mailing for the city’s 3 million registered primary voters. That didn’t go out until mid-May.

Every ballot request needed to be approved by a bipartisan set of staffers, then entered into the voter rolls. Then a court dispute about the presidential primary delayed the finalization of the ballot, which the BOE didn’t begin sending out until three weeks before the election.

That’s where the U.S. Postal Service comes in. Mail-in ballots are in the hands of a federal agency on the brink of bankruptcy that had to sideline 17,000 workers on quarantine because of exposure to the virus. Louis DeJoy, a Trump donor recently appointed as postmaster general, has announced cost-cutting changes that will probably further slow mail delivery.

At every turn, the governor’s executive orders and the BOE’s deadlines were out of touch with the Postal Service’s abilities. The final date for voters to send in absentee applications was June 16, an impossible seven-day turnaround for the application to get to the BOE and a ballot to get to the voter in time to cast it.

But in New York, there was another issue. The governor’s executive order called for the ballots to have business-class postage-paid return envelopes. In a normal year, voters provide their own stamp, which is considered first-class mail and always postmarked. The USPS said it is also their policy to postmark all ballots. It is not standard, however, as voter advocacy groups have said, to postmark the type of business-class mail used in New York’s primary election. If you drop it off in a mailbox it is simply sent to its destination. It seems as though the postage class created confusion among some USPS employees.

The only way for a voter to guarantee a postmark would have been to stand in line at a post office and watch a teller do it, rather than drop it in a box, which defeats the public health benefit of mail-in ballots.

Upon review of what happened in New York, USPS spokeswoman Martha Johnson said, “We are aware that some ballots may not have been postmarked and have taken actions to resolve the issue going forward.”

On Wednesday night, Cuomo and New York Attorney General Letitia James responded to the lawsuit Patel joined by saying that allowing un-postmarked ballots was “not in the public interest because it would upend the rules . . . after the election has already taken place.”

Patel quickly looked into a new legal strategy and has secured an expedited hearing that may happen as early as Thursday.

“This is not the fault of vote by mail,” he said. “I’ve always been an advocate of vote by mail. It increased participation to astronomical rates for a congressional primary. But, man, is New York unprepared to have the procedures in place to count these ballots in a timely fashion.”

Of course, he still wants to know the outcome.

“It might be that we open up those ballots and they all go to Maloney. It’s not my job to decide who gets to vote,” he said. “At least we’d know what the actual intention of New York-12 was.”

Correction: A previous version of this story misstated the year Suraj Patel moved to New York. He moved in 2006, not 2010.

Michelle Ye Hee Lee and Elise Viebeck contributed to this report.