On Monday, soon after noon, Senate Minority Leader Chuck Schumer announced that he and Majority Leader Mitch McConnell had reached a deal to end the shutdown of the government, and to keep it open until February 8th. Schumer portrayed this as a victory, because, he said, McConnell had promised to bring legislation to the floor to address the plight of the Dreamers—young, undocumented Americans brought to the country as children—with a fair debate. That is an opening, not an ending; McConnell has worked his way out of such promises before. At the same time, Schumer quickly passed over the most solid victory in the bill to end the shutdown: six years of funding for the Children’s Health Insurance Program, or CHIP. This means that the nine million children who rely on CHIP are no longer on the brink of losing their coverage. (Funding for it officially ran out at the end of September, and it has kept going since then only thanks to the budgetary equivalent of scrounging and foraging.) That is something that Democrats should be celebrating—even as it might cause them to reflect on whether they miscalculated in letting the government shut down in the first place.

The CHIP money is not a new addition to the Monday deal. It was in the bill that failed on Friday, when all but five Democrats (along with five Republicans, including, for parliamentary reasons, McConnell) voted against it, triggering the shutdown. (One of those five Democrats, Senator Doug Jones, of Alabama, fresh from defeating Roy Moore in a special election, cited the “strong commitment” that he had made to CHIP on the campaign trail as his reason for doing so.) Partly as a result, the matter of CHIP, which had, in the past few months, been a rallying cry for Democrats, has, in the past few days, been turned against them, with Republicans baldly claiming that Democrats don’t care about children’s health. (“The Democrats are turning down services and security for citizens in favor of services and security for non-citizens. Not good!” Trump tweeted on Monday morning.) This is utterly cynical demagoguery—especially as it was accompanied by a truly shameful ad released over the weekend by Trump’s reëlection-campaign committee (which is already at work) asserting that Democrats would be “complicit” in any murders committed by undocumented perpetrators. What anything in the bill had to do with such theoretical murders was obscure. And there is something enraging about McConnell, who had stalled for months on bringing CHIP to the Senate floor, piously reminding his colleagues how “vulnerable” these children are. But it’s also a move that the Democrats should have seen coming, and should have had a better plan for addressing. Instead, Democratic senators just kept pointing out how hypocritical and sneaky the G.O.P. was being. For many Americans, though, that charge is not a news flash when applied to politicians of either party.

The expiration date for the final Dreamer protections is in early March. Each day brings more uncertainty for those who were formerly protected by the Deferred Action for Childhood Arrivals program, which Trump renounced; thousands have not, for one reason or another, had their status renewed. They deserve that the remaining weeks be used productively, not squandered. The Friday bill would have kept the government open only four more weeks, and so allowed time for another showdown—at which point there might have been an actual deal on the table; at the moment, there is not. If anything, having CHIP finally taken care of leaves the Democrats in a stronger position for hard negotiations: they are less vulnerable to extortion, and to the pressure of children, state by state, being shut out of doctors’ offices. Each state has its own program and eligibility formula for CHIP, with different calendars and, in some cases, with more of a potential backstop in Medicaid (though states could cut back there, too). But more than a million and a half children were expected to lose coverage in the next few weeks. Many states had already sent out letters to families telling them not to count on CHIP for their children’s care, the kind of message that leaves any parent feeling helpless, humiliated, lost, or—rightly—angry.

The decision of the Republican leadership to put long-term CHIP funding in the bill was a bluff that the Democrats could and should have called earlier. There is no actual logic in portraying votes like those of the Democrats who voted Friday to keep the government open as a betrayal of the Dreamers, or as a trade-off of one group or the other—even if some Democrats themselves saw it that way. But they could have taken that win without compromising their position on immigration—it would have done so less than Schumer’s notion of helping Trump build his wall. And McConnell’s commitments now are too tenuous to explain why it was worth the risk that CHIP would be taken off the table.

What should be discouraging for anyone who hopes that the Democrats can close a deal for the Dreamers—and, beyond that, present a coherent program that Americans can vote for in 2018 and 2020—is how clumsy it all was. Negotiating with Trump surely is, as Schumer complained, like trying to handle Jell-O. Trump really is an extremist on immigration, one who has surrounded himself with hard-liners like John Kelly, his chief of staff, and his policy aide Stephen Miller. So what’s the plan? CHIP has been funded; the focus now is on protecting Dreamers, and the question is how to do it. What did the Democratic Party’s leadership think it won with this shutdown? And what will it get next time around?