When the history of the 2018 midterms is written, there will be a chapter on missed opportunities for Democrats. Some may wonder if they should have spent so much money supporting Beto Oโ€™Rourke in Texas, or whether Heidi Heitkamp was doomed from the start in North Dakota. One painful question for progressives will be whether it was a good idea to spend millions trying to unseat House Intelligence Committee chairman Devin Nunes.

The Los Angeles Times reports that Democrat Andrew Janz, a first-time candidate, raised $4.3 million in three months, a sum it calls โ€œa staggering amount in a district that analysts had written off as a lock for Republicans.โ€ Those analysts have a point. Nunes has never won less than 62 percent of the vote; he ran unopposed in 2010. His familyโ€™s roots in the farming community go back generations, and local farmers love him for his indefatigable fight for more water to be used for agriculture instead of preserving wetlands. In Californiaโ€™s โ€œjungle primaryโ€ system, where the top two finishers advance, regardless of party, Nunes won 58 percent, and Janz won 32 percent.

Janzโ€™s flood of donations arrives as a lot of other California Republican House members find themselves in choppy waters. Recent polling indicates that Democrat Josh Harder has a serious shot at unseating incumbent Representative Jeff Denham in Californiaโ€™s 10th Congressional District. In the 49th District, where Darrell Issa is retiring, Democrat Mike Levin enjoys a 55 percent to 41 percent advantage over Republican Diane Harkey, and Democrat Katie Porter leads GOP incumbent Mimi Walters in the 45th Congressional District.

In fact, of eight competitive California congressional races surveyed by Berkeleyโ€™s Institute of Governmental Studies, Nunes was in the best shape of any Republican, leading 53 percent to Janzโ€™s 45 percent.

The question of why many Democrats are dumping money into this particular long-shot challenger is not a great mystery. Many Democrats fervently believe that Donald Trump did something sinister with the Russian government in the 2016 campaign. Nunes chairs the Intelligence Committee, has access to just about all of the relevant intelligence, and has publicly scoffed at the claims of collusion. He argues instead that thereโ€™s been stunning bias in favor of the Clintons and mismanagement at the top levels of the FBI. This outrages many Democrats, so they want to see him defeated, even though he ranks among the most electorally secure GOP members of Congress in the state.

At first, Janz wanted to make the race a referendum on Trump; last November he unveiled a billboard that depicts Trump and Nunes on Vladimir Putinโ€™s leash. This may not be such a wise move; Trump won this district 52 percent to 42 percent in 2016, and the Berkeley poll found that 56 percent of likely voters in Nunesโ€™s district approved of Trumpโ€™s job performance and 44 percent disapproved.

Back in May, the Janz campaign unveiled a video that accused Nunes of putting together a โ€œbrainwashing memo that picks and chooses its facts.โ€ The ad even used audio of an unidentified news commentator asking, โ€œIs it possible that Congressman Nunes, the Republican chairman of the House Intelligence Committee, has been compromised by the Russians?โ€

Somewhere along the line, the Janz brain trust must have figured out that running on the theme of โ€œour opponent could be a sleeper agent for Moscowโ€ isnโ€™t a winning message.

Janzโ€™s current biographical ad is painfully cookie-cutter โ€” โ€œIf a bunch of D.C. insiders come after me for putting my community first, I say bring it onโ€ โ€” and thereโ€™s almost nothing that hints that heโ€™s a Democrat. He talks about โ€œputting bad guys in jail,โ€ immigrantsโ€™ pride in their community, โ€œnot letting them take Social Security and Medicare,โ€ and securing water for the Central Valley. Another focuses on โ€œputting violent gang members behind bars,โ€ the kind of message that is dismissed as xenophobic hysteria when a Virginia Republican runs on this theme. The word โ€œDemocratโ€ does not appear in Janzโ€™s ads.

Facing such an uphill climb, Nunes critics celebrate various developments as key indicators of an upset in the making. The Fresno Bee, which Nunes has been fighting with for the past two years, didnโ€™t endorse Nunes for the first time in his career. Janz supporters say Nunes supporters are stealing their lawn signs! The band Cake is coming to town to campaign for Janz!

But newspaper endorsements and concert rallies wonโ€™t change the fundamentals of the congressional race, most notably that this is one of the few conservative, Republican-leaning districts in California: Registered Republicans outnumber registered Democrats by more than 32,000. Despite the most heavily covered and hard-fought race in Nunesโ€™s career, thereโ€™s been a marginal increase in the number of registered voters. Nunes is well-known and well-liked, and he has all the advantages of incumbency.

Whatever else the midterms bring, the morning after Election Day, California Democrats may wake up with a hangover, look at the millions spent against Nunes that could have been used in more competitive races elsewhere, and ask โ€ฆ โ€œWhat were we thinking?โ€