By Richard Lister
BBC News, Washington
A year ago Washington was full of morose Republicans.
Mr Obama trails Mr McCain in one recent poll
They were watching President George W Bush's approval ratings scrape historic lows, the economy heading for the doldrums and continuing slaughter in Iraq - despite the surge of American troops.
The Republican Party seemed underwhelmed by its choice of presidential candidates and it was not hard to find party activists hunched over a beer and staring blankly into the middle distance, conceding that the Democrats seemed to have the White House wrapped up.
Republican White House hopeful John McCain in particular was struggling to hang in there.
Running third or fourth in the Republican race, he had shed campaign staff and was running on empty.
As 2008 dawned, the media buzz was all about the Democratic contenders Barack Obama and Hillary Clinton.
Even after Mr McCain bubbled up to the top of the Republican shortlist, the national fascination stayed with the historic Democratic contest.
When Mr Obama surged ahead, the news media went into overdrive and, according to the Campaign Coverage Index from the Pew Research Centre, there has been more coverage of him than Mr McCain in the US news media every month this year.
So, Mr Obama gets more press, has raised more money, has a broader donor base and draws far bigger crowds - game, set and match?
Barack Obama heads into his convention with a lead of no more than one to three points in most polls (a statistical dead heat) and at least one suggests he is now the underdog.
A Zogby poll on 20 August put Barack Obama five points behind his Republican rival, reversing the seven-point lead the pollster had given him the month before.
The question Mr Obama's staffers are pondering is, why?
No-one, of course, really knows.
But the alchemy of electioneering allows for some educated guesses about this recent dip in the polls.
Voters have heard too much of the Obama message - but they still do not really get it
By taking a holiday in Hawaii, Mr Obama gave Mr McCain the stage to himself for a while and the Republican made the most of the Georgia crisis, underlining his weighty international experience.
As relatively high fuel prices caused many Americans to forgo their annual road-trips, Mr McCain also pushed his energy policy message calling for new offshore oil drilling.
Mr Obama once opposed that idea, but now supports limited new drilling and that flip-flop has been a gift to the Republicans.
It is that kind of "bumper sticker" issue that Mr McCain has been able to capitalise on more effectively than Obama, clearly defining his candidacy.
When asked about offshore drilling, Mr McCain is for it.
Mr Obama is much more nuanced: he is for it in some circumstances, but sceptical that it will really work.
Or take Mr Obama's less-than-successful appearance with Mr McCain at a religious forum earlier this month.
When both were asked: "When does life begin?", Mr McCain immediately said: "At the moment of conception".
Mr Obama first said that answering the question was "above my pay-grade" before adding that he was in favour of legal abortion "not because I'm pro-abortion but because, ultimately, I don't think women make these decisions casually. I think they wrestle with these things in profound ways."
Try putting that on a bumper sticker.
Mr Obama's cerebral, measured approach may be one of the reasons he has been unable to open a substantial lead over John McCain.
The single biggest question hovering over his candidacy though is whether white America is yet ready to vote in a black President. An AP/Yahoo poll earlier this year said that 8% of white voters it asked admitted they would be uncomfortable voting for an African-American candidate.
The Obama team has done its best to ensure that he is not portrayed as the "black candidate", by not overtly courting African American political icons like Jesse Jackson and Al Sharpton.
But whether Obama has been able to sway enough of those "uncomfortable" white voters won't be known until November, and its clearly been tough for him to get some people to look beyond his colour.
McCain had a definite head start in defining himself as a candidate because he did not have to spend time introducing himself - he has been hovering in the national consciousness for decades.
Mr McCain has been pushing his policy on oil exploration
But it has been much harder for the young, first-term senator from Illinois to embed an image in voters' minds of what makes him tick.
Even after the prolonged Obama media blitz, a Pew Research Centre poll last month suggested that only 57% of voters even knew he was a Christian. More than one in 10 still thinks he is Muslim.
Increasing numbers of those voters are also (again according to polls) saying they are bored with the relentless coverage of Mr Obama and would like to hear more about Mr McCain.
That is a double whammy for the Obama team: voters have heard too much of the Obama message - but they still do not really get it.
On the issue that the candidates are most divided on - Iraq - recent events are also tending to neutralise Mr Obama's arguments to some extent.
Mr McCain's pro-war stance was initially perceived as a weakness, but the surge he pushed for has been successful, and Iraq is off the front pages.
Mr Obama has been saying for months that it is time to set out a framework for pulling troops out and there is every likelihood that the Bush administration will do just that in the coming weeks, citing security improvements.
So, come November, Mr Obama and Mr McCain may not be that far apart on the issue after all.
The electoral battleground has shifted just as much over the past year as the real battleground in Iraq.
But the difference is that the fight here between the old warrior and the young pretender has become even bloodier, and the outcome less certain.