Pennsylvania’s primary election and Senate race recount are over. But as the state heads into yet another high-profile and contentious November, elections officials and lawyers are warily acknowledging something:

It’s starting to feel a bit like 2020.

The fight over how votes are cast and counted has once again taken center stage, and officials are bracing for another torrent of litigation. Lawyers are already preparing for a series of court battles over which ballots should count, at a level on par with the most thoroughly litigated election in the state’s history two years ago.

New lawsuits have revived questions that many thought were long settled, beginning with the question of whether to count undated mail ballots. And as court fights over the issue have played out, they’ve empowered new attempts to allow “naked ballots” missing their inner secrecy envelopes, as well as ballots that arrive after the deadline set by state law.

Even mail voting itself is in question, challenged before a Pennsylvania Supreme Court poised to rule at any moment on the law that authorized it.

Democrats see an opening to get more ballots counted — including ones they thought they’d already lost the fight over. Republicans see the ground they thought they’d gained with court victories in 2020 suddenly eroding, and are marshaling armies of lawyers in response.

And elections officials are once again caught in the middle, saying the shifting landscape has left them mired in uncertainty as rules that seem to be ever-changing fuel public distrust and confusion.

No matter where they’re coming from, everyone is generally making the same plea to courts: Give us some certainty. And don’t wait until November.

“The current law in Pennsylvania is very much in flux because of recent court decisions,” said Joshua Voss, a Republican lawyer involved in one of the ongoing court fights. “And that uncertainty should be fully and finally resolved by the Pennsylvania and U.S. Supreme Courts before the fall general election.”

A lot seemed settled after the 2020 election

No Pennsylvania election was as litigated as 2020 — one that saw huge changes in how many Pennsylvanians cast their votes.

A new law known as Act 77 dramatically expanded mail voting just in time for record demand due to the pandemic, and elections administrators, voters, campaigns, and lawyers scrambled to figure out the rules for how those votes can be cast and counted.

Lawsuits poured in from all sides in the months leading up to and following Election Day. Donald Trump’s campaign sued. So did the Pennsylvania Department of State, the state Democratic Party, the NAACP, individual candidates, and groups of voters representing various interests.

Some lawsuits raised issues about the law itself, such as whether naked ballots must be counted. Others focused on the challenges of voting during a pandemic, seeking one-time changes such as extended deadlines due to U.S. Postal Service delays.

» READ MORE: Trump and his allies tried to overturn Pennsylvania’s election results for two months. Here are the highlights.

And while much of the attention was on Trump’s failed legal bids to overturn his loss in Pennsylvania, courts issued decisions that have shaped whether the ballots of thousands of voters each election cycle are counted.

Naked ballots? Reject them, the Pennsylvania Supreme Court said.

Ballots that arrived late but were postmarked by Election Day? Not allowed, the court ruled, though it gave a one-time extension of three days just for 2020.

Ballots missing a voter signature on the mailing envelope? Throw them out.

Some of the questions divided the courts hearing them, such as a split ruling by the Pennsylvania high court that has guided subsequent decisions to reject undated mail ballots in elections after 2020.

It was a decision that seemed to spell out clear guidelines. And the Pennsylvania Department of State, which oversees elections, reminded counties last year to throw out undated mail ballots.

When Philadelphia elections officials initially moved to include them in their counts, Republican lawmakers threatened to impeach them. The city ultimately reversed course.

Now things are suddenly up in the air again

So it seemed as if a lot of ground rules had been established in 2020. After all, the world had just watched as millions of Pennsylvania votes were slowly counted, with the presidency in the balance.

But new challenges soon began to percolate.

Republicans, including lawmakers who had voted for Act 77, filed two lawsuits last summer challenging the law, calling it unconstitutional because the state constitution specifically describes absentee voting but not no-excuse mail voting.

This January, the conservative state Commonwealth Court agreed, overturning the law and setting up an appeal to the Pennsylvania Supreme Court, which left mail voting in place while it considers its ruling — one that could come at any time. Until then, uncertainty hangs over the future of a voting method that millions of Pennsylvanians have now used.

Meanwhile, questions over undated mail ballots emerged again in Lehigh County. Elections officials there moved to count them last November, a decision that Republicans quickly challenged. A state lawsuit ended with the Commonwealth Court reiterating the status quo — under state law, they must be rejected. The Pennsylvania Supreme Court declined to take up the case.

But that wasn’t the last word.

» READ MORE: The Pa. Senate race recount is complete and the results show how accurate the vote count was

In May, the U.S. Court of Appeals for the Third Circuit ruled the undated Lehigh County ballots from last year’s election should be counted. The decision concerned one county’s election, not the law itself, and it was based on an interpretation of federal voting laws, unlike the state rulings that came before.

Still, the impact was immediate and left elections administrators and candidates across the state scrambling to figure out whether it meant undated mail ballots should be counted in the 2022 primary, too.

Republican Senate candidate David McCormick, seeking an edge in his tight race against Mehmet Oz, broke with his party’s traditional stance on the issue and sued to include them, adopting the federal appeals court’s logic in a new suit before the Pennsylvania Commonwealth Court.

McCormick succeeded in persuading the court’s president judge, Renee Cohn Jubelirer, to issue a temporary order for them to be counted — where her court had previously ruled to reject them.

But he conceded the race to Oz and asked to drop his suit.

Attorneys for acting Secretary of State Leigh M. Chapman urged the court to keep the case alive and provide a final decision on undated ballots for the future.

“It is an unsettled question in Pennsylvania courts,” they wrote. “This year alone, Commonwealth Court judges have come to different conclusions in three cases as to whether those ballots must be canvassed.”

Cohn Jubelirer dismissed the case last week without that resolution.

The changing legal landscape creates an uncertain future

Lawyers from all sides are preparing for the legal battles to come.

The state and national Republican Parties have vowed to fight their Third Circuit loss on undated mail ballots at the U.S. Supreme Court. They’ve discounted the Commonwealth Court ruling in McCormick’s case, asking Cohn Jubelirer to vacate her decision — a request she denied last week.

That means her opinion, though a preliminary ruling, remains on the books, providing a clear road map for future plaintiffs — and for the state Supreme Court — to rule in favor of counting undated ballots under both state and federal law.

The McCormick case “highlights the chaos that the Third Circuit has unleashed on Pennsylvania,” Republican election lawyer Cameron T. Norris wrote in a letter urging the U.S. Supreme Court to intervene.

» READ MORE: David McCormick, Mehmet Oz, and the politics behind undated Pennsylvania mail ballots

Democrats — and Democratic Gov. Tom Wolf’s Department of State, which oversees elections — argue that it only makes sense that the same logic the Third Circuit used in deciding to count them in the Lehigh County case would apply to every other race going forward.

The appeals court based its decision on the idea that the state’s dating requirement was immaterial to the goal of determining whether it had been cast by an eligible voter. In practice, ballots with obviously wrong dates — such as the voters’ birth dates — were being counted.

Tossing the ballots of otherwise eligible voters over a technicality, the court ruled, was a violation of federal civil rights law.

The Commonwealth Court decision also cited a similar basis in state law: the state constitution’s guarantee that “elections shall be free and equal.”

Elections lawyers are already thinking about what these new arguments could mean for Pennsylvania voting requirements that were once thought settled.

Late last month, a group of voters in Lehigh and Northampton Counties picked up the new argument and sued over state rules requiring late-arriving and naked ballots be rejected.

The parties settled the case this week, before a federal judge in Allentown could issue a ruling, leaving the underlying questions unanswered.

Still, Republican lawyers have seized on the suit as an example of the “chaos” recent litigation has unleashed — and there’s likely more to come.

The evolving legal landscape means courts could soon provide a whole new set of answers to some of the fundamental questions of 2020: Which votes should be counted, which should be rejected, and where does Pennsylvania draw the line?