Washington (CNN) After two dramatic defeats of immigration legislation this year, Congress left for August recess eager to put the issue in the rearview mirror, with consequential midterm elections looming in November.

But it might return to an unavoidable storm nonetheless.

Major court decisions are looming on the fate of the Deferred Action for Childhood Arrivals program , a popular policy that protects from deportation young undocumented immigrants who came to the US as children that President Donald Trump is seeking to end.

After arguments Wednesday in a Texas court , it is possible a judge could soon rule to end the program altogether -- which would directly conflict with other court decisions that the program must remain open, and likely blaze a fast track to the Supreme Court.

The House and Senate have each tried and failed to pass legislation that would have made DACA permanent this year, despite the vast majority of lawmakers saying it was a priority to do so.

On top of the looming DACA situation, Congress must pass government funding by the end of September, and Trump is pushing for more money for his border wall. The President has even threatened a government shutdown if he does not get the funding for the wall, though congressional leaders have said Trump apparently agreed to wait until after the midterm elections for that battle.

Throw in a fight over the next Supreme Court justice and the House Republican majority seemingly in serious jeopardy, and lawmakers may be returning to a mess they can't escape.

"This is the perfect storm of immigration that's coming to the doorsteps of the Republican Party, and they are not prepared," said Ali Noorani, executive director of the pro-immigration advocacy group National Immigration Forum.

The Senate and the House suffered bruising battles earlier this year trying to preserve DACA after Trump announced last September that he would end it.

In the Senate, a bipartisan compromise bill was defeated in February after a battle with the administration, and a White House-developed bill failed -- with fewer than 40 votes -- in the 100-member chamber.

In the House, Republicans negotiated for weeks on something that would work amid an insurrection by moderate members pushing for a DACA compromise. The result of those negotiations failed embarrassingly in June.

Once the courts ordered the administration to continue renewing DACA permits, some of the pressure was off Congress. Republican leadership in both chambers have shown no appetite to return to the issue, especially heading into a fraught election cycle.

Republicans' divisions on the program have been laid bare in the process, pitting hardline conservatives who refuse to accept any path to citizenship for DACA recipients against moderate Republicans from diverse districts who see it as their only acceptable outcome.

But the judge in the Texas DACA case is seen as particularly likely to rule the program has to be ended. That judge was the one to block a similar program from going into effect in 2014.

Meanwhile, appellate courts in California and New York are considering the orders to keep the program running, and another district court has ordered the government to reopen the program in full, including new applications.

The issue is likely to reach the Supreme Court regardless. But if those conflicting orders were to happen in the next month, as is increasingly likely, it could fast-track the issue for consideration this fall.

"As much as Republicans would love to avoid the topic of immigration in Congress, the fall of 2018 is lining up to be an epic immigration debate," Noorani said.