Democrats are sure to bash the Trump administration and get fired up over the 2018 midterms when they gather in San Diego for the state party convention this weekend. But when it comes to handing out the coveted party endorsement, one of the state’s most legendary politicians could be in for a major snub.

Sen. Dianne Feinstein, a 25-year-incumbent, is on paper the favorite to win the state party endorsement in her bid for a fifth full term. But the activists and delegates who show up for party conventions tend to be more liberal than the average Democratic voter in the state, which could help her main challenger, State Senate leader Kevin de León.

It won’t be easy for either team to secure the 60 percent of delegate votes needed to win the official party backing. That high threshold makes a party endorsement even less likely in the also-competitive governor’s race, where a crowded field of Democrats is facing off.

Both Feinstein and de León’s campaigns have showered attention on the more than 3,000 party delegates over the last few weeks — a sign that they’re taking the endorsement vote Saturday afternoon seriously. Feinstein hosted a conference call with several hundred delegates, sent them mailers and advertised to them on social media, while de León has met personally with delegates up and down the state, his campaign says.

Start your day with the news you need from the Bay Area and beyond.

Sign up for our new Morning Report weekday newsletter.

“The party endorsement has always been Feinstein’s to lose,” said de León spokesman Jonathan Underland. “But this election marks the first time she’s really engaged with the party convention in decades — she recognizes that California Democrats see her as being out of step.”

Another liberal candidate for Senate, defense lawyer Pat Harris, will also be on the endorsement ballot, although activist Alison Hartson, who’s raked in small-dollar donations, will not. Delegates can also choose to vote for no endorsement.

“My sense of it is it’s very hard to get to 60 percent for anybody,” said Bill Carrick, Feinstein’s longtime campaign strategist. “She’s going to talk about her record and what she wants to get done.”

Winning support from the party faithful in the convention hall doesn’t always mean much. When Feinstein ran for governor in 1990, she dramatically declared her support for capital punishment at the state convention, over loud boos from the hall. The party’s delegates endorsed her rival, Attorney General John Van de Kamp. But Democratic voters as a whole agreed with Feinstein on the issue, and she won the primary that year.

“The people who are motivated to give up a weekend to show up at a party convention are further off the middle of the political spectrum,” said Darry Sragow, a political analyst and Feinstein’s 1990 campaign manager, who is not involved with this year’s Senate race.

Still, if de León does manage to win the party backing, it would be a significant boost for a candidate who has struggled to raise his poll numbers.

The party endorsement votes will also be closely watched in races for Congress up and down the state. Democrats are banking on wins in California — especially in the seven districts won by Hillary Clinton in the 2016 presidential election — to help them retake the House of Representatives this year.

Research suggests that a party endorsement is more important in those lower-profile races where candidates are less well known. Thad Kousser, a political science professor at UC San Diego, studied the effect of the party endorsement in 2012 and found that in down-ballot races, it gave candidates about a 10 percent boost.

“It’s so hard for voters to learn all the details about who candidates are and where they stand,” Kousser said. “The party endorsement fills that information vacuum.”

The party has seen candidates come out of the woodwork to run for Congress this year, and Democrats have found success in fundraising so far. But in several districts, the huge enthusiasm of Democratic candidates could come back to bite them — if multiple Democratic candidates divide the vote in the top-two primary, they could allow two Republicans to make it to the general election.

A poll released this week by an independent Democratic group illustrated the problem in retiring Rep. Darrell Issa’s district. In several permutations of possible election matchups, it found two Republicans, Rocky Chavez and Diane Harkey, leading the field, while the five credible Democrats trailed narrowly behind.

Get breaking news with our free mobile app. Get it from the Apple app store or the Google Play store.

In competitive districts like these, Democrats need to winnow out some of their own candidates in order to avoid the disaster of being shut out of the general election — and the party endorsement could be a big step in that process.

Even as they strategize for 2018, party members will also hear from a host of possible contenders for the presidency in 2020, including Sen. Kamala Harris, Los Angeles Mayor Eric Garcetti, San Francisco hedge fund billionaire Tom Steyer, and Oregon Sen. Jeff Merkley.

Meanwhile, this year’s convention will also operate under a cloud of worry over sexual harassment. The typically booze-soaked parties are expected to be tamer this year, and the party has launched a new 24-hour hotline to report sexual harassment and assault and hired stepped-up security for events.

It was at the 2008 party convention in San Jose that State Senator Tony Mendoza allegedly attempted to seduce his 19-year-old female intern, according to her account. Mendoza resigned abruptly Thursday amid an attempt to expel him from office after an investigation corroborated several claims of inappropriate behavior against him.

Delegates will also be voting this weekend on whether to endorse Mendoza — his spokesman said he is running for re-election.