This has been a rough week for Republicans and for Democrats. As the long August recess begins, these are not happy times for either political party.

The Democratic presidential candidates put on two nights of debating in Detroit, producing maximum internal bickering and negativity and minimal positive or outward messaging to voters who will decide the 2020 election.

On the first night, the ideological split within the party broke wide open. Sens. Elizabeth Warren (Mass.) and Bernie Sanders (I-Vt.), the two most left-leaning candidates on the stage, dominated their less-liberal rivals.

On the second night, the Democrats turned on one another, rather than President Trump, and did so in smaller and less substantive ways than their colleagues on night one. Former vice president Joe Biden bore the brunt of the attacks, though he was not alone. In the process, even former president Barack Obama took it on the chin at times.

Tuesday’s session sparked a useful debate about what a post-Obama party should stand for and look like to attract as many voters as possible. But it raised obvious concerns about whether Democrats are veering too far to the left to win a general election against Trump. Wednesday’s session somehow managed to diminish virtually everyone onstage but didn’t much change the nomination contest.

Presidential candidates aren’t the only Democrats who are squabbling with one another. House Democrats, who should still be flush with the victory they engineered in the midterm election in November, are split down the middle over the biggest issue before them.

Should they start an impeachment inquiry against the president, as half their caucus now favors? Or, as Speaker Nancy Pelosi (D-Calif.) prefers, should they hold back indefinitely or at least until they have more public support and more grounds for impeaching the president?

The political considerations are fraught. Democrats resistant to an impeachment proceeding, regardless of how they feel about the president’s actions as outlined in the report from former special counsel Robert S. Mueller III, worry that going ahead will compromise the party’s hopes of defeating Trump in 2020.

But political calculations are only one part of the discussion. Trump’s actions have raised constitutional issues about the balance of power between the legislative and executive branches and the topic of presidential accountability. Those questions cannot easily be pushed aside.

Pelosi put out a statement on Friday vowing that House Democrats would continue to “legislate, investigate and litigate.” She said Democrats would work to assure that the checks and balances in the Constitution are enforced. She did not warm to impeachment, however. But are House Democrats sliding toward an impeachment proceeding in the absence of a collective decision by the leadership to do so?

Democratic presidential candidates take on the Obama legacy

House Democrats are also caught up in their version of the ideological conflict of the presidential campaign. This is a struggle between a rising insurgency on the left and a liberal, institutional establishment that is nervous about whether that puts the party’s newfound House majority at risk.

This conflict is symbolized by the issue of whether the four young liberals known as “the Squad” — Reps. Alexandria Ocasio-Cortez (N.Y.), Rashida Tlaib (Mich.), Ilhan Omar (Minn.) and Ayanna Pressley (Mass.) — are becoming the public face of a new and far more liberal party.

Trump’s decision to attack the group with a racist tweet urging them to “go back” from where they came (three “came from” the United States and the fourth is an immigrant who is a U.S. citizen) united Democrats against him in solidarity with the four freshman House members. But the tensions over their prominence and public advocacy are real and remain so.

Democratic research has brought to light the visibility of Ocasio-Cortez to a broader audience and the risks that her fearless activism, as well as her skill and reach with social media, gives her outsized influence that could affect more moderate freshman Democrats running in swing districts next year.

Yet the energy and appeal of those new members to younger voters, including African Americans and Latinos, who turn out to vote at lower levels than other groups, is a vital part of the rising Democratic coalition and to the party’s longer-term electoral aspirations.

The physics of politics generally mean that when one party is up, the other is down; when one is confident, the other is nervous or pessimistic. In the age of Trump, those rules, like so many others, don’t apply. Everyone seems to have something to worry about, which means Republicans are also suffering this summer.

Trump commands rank-and-file support in a remade Republican Party, but there are plenty of other indications suggesting that many Republican officials and strategists fear the effects of his disruptive behavior and tactics. Having attacked the four congresswomen, he spent last week attacking Rep. Elijah E. Cummings (D-Md.), who is African American, and running down the city of Baltimore.

Republican officials worry that, the longer the president continues down the path of nativism and of stoking racial division, the more the GOP is at risk of seeing its coalition shrink, eventually to become a party almost exclusively for and of white voters and particularly of older men.

Hurd’s retirement is a bow to the Trump realignment of the GOP

That issue crystallized recently when Rep. Will Hurd (R-Tex.) announced he would not seek reelection in 2020. Hurd, a former CIA official, is the only African American Republican in the House. He was one of just four Republicans to vote for the resolution condemning Trump’s racist tweets against the Squad.

Hurd represents a district that sprawls along the U.S.-Mexican border, from western San Antonio roughly almost to El Paso. He barely won reelection in the heavily Hispanic district and he would have had a difficult time winning in 2020. It’s doubtful any other Republican on the horizon will be able to hold that seat.

Before Hurd made his announcement, Reps. Susan Brooks (R-Ind.) and Martha Roby (R-Ala.) had announced that they would not seek reelection. They are two of just 13 women in the House Republican Conference. In the previous Congress, there were 23 Republican women in the House. The decline in female representation among Republicans came as House Democrats saw the 2018 election increase the number of their female representatives from 64 to 89.

Hurd, Brooks and Roby are three of a series of recent retirements among House Republicans, including several in districts that are opportunities for Democratic pickups. The departures collectively suggest that these Republican retirees are pessimistic about the GOP’s prospects for recapturing the majority in 2020 and that life in the minority, after years in the majority, holds little joy for them.

But it is also clear that House Republicans in competitive seats in 2020 run with the added burden of a president at the top of the ticket whose behavior adds energy and incentive to many voters to vote against him and them. Most Republican elected officials have been too timid to speak out about the damage to the party that Trump may be causing, but their fears are real.

With more than a year until the general election and with many months and turns ahead for the Democratic presidential candidates and members of both parties in the House, some things will change. This summer of discontent will give way to something else. The parties will find ways to rally themselves together ahead of 2020. But the forces at work mean neither party will fully escape the turmoil of these times.