On May 3, 2017, Comey appeared at a Congressional hearing (not mentioned in the book) and declared publicly:
... we [the FBI] don't confirm the existence of investigations except in unusual circumstances.
We don't talk about closed -- we don't talk about investigations that don't result in criminal charges unless there is a compelling public interest. And so those principles should still govern. We also whenever humanly possible avoid any action that might have an impact on an election. I still believe that to be true and an incredibly important guiding principle. It's one that I labored under here.
.... those principles still exist; they're incredibly important. The current investigation with respect to Russia [and the Trump campaign] -- we have confirmed it [the existence of the investigation].
The Department of Justice has authorized me to confirm that it [the investigation] exists. We're not going to say another word about it until we're done. Then I hope, in league with the Department of Justice, we'll figure out if it doesn't result in charges, what if anything will we say about it, and we'll be guided by the same principles. ...
We're conducting an investigation to understand whether there was any coordination between the Russian efforts and anybody associated with the Trump campaign.
Six days later, on May 9, Trump fired Comey. On May 12, Trump tweeted:
James Comey better hope there are no 'tapes' of our conversations before he starts leaking to the press.
I think that, to some extent, Trump had in mind the two conversations on January 6 and March 30 when Comey denied any FBI investigation of Trump. I think also that, by May 9, Trump had been told that the FBI indeed had investigated Trump. In other words, Trump fired Comey because Trump had learned that Comey had lied to him twice. If necessary, Trump would reveal those two lies to the public.
=====
For the sake of argument, let's suppose that the FBI Counterintelligence had been investigating Trump personally since 2012 and that Comey knew that fact in 2017 when he assured Trump that there was no FBI investigation of Trump personally.
Future historians might write that Comey's lies to Trump were unethical. In the future, such lies -- the FBI Director denying an FBI investigation falsely to the President -- might be characterized as "pulling a James Comey".
This consideration might motivate Comey to communicate publicly, for the historical record, that he never had denied to Trump that the FBI ever had investigated to him. However, Trump's tweet now inhibited Comey from ever claiming he never had uttered such a denial to Trump.
======
Of course, the considerations in the above section are based on the supposition that FBI Counterintelligence was investigating Trump since 2012.
That supposition might be false. Perhaps the FBI really had investigated only a few members of Trump's campaign staff -- Carter Page, George Papadopoulos, Michael Flynn and Paul Manafort -- but never had investigated Trump himself.
If so, then Comey had acted ethically. Comey had assured Trump truthfully that the FBI was not investigating him.
======
Although an FBI Counterintelligence investigation of Trump should have been known only to a handful of FBI officials, the FBI's 2016 investigation of Hilary Clinton's e-mails -- the so-called Midyear Exam investigation -- created a situation where that secret might have spread. Comey's book describes the Midyear Exam team as follows:
To handle the [Clinton e-mails] case, the FBI's Counterintelligence Division brought together a group of about twenty experts — made up of agents, analysts, and support personnel. As the division normally did, they gave the case an obscure code name: Midyear Exam.
The group I regularly dealt with about Midyear ranged from the senior-most FBI executives to the supervisory agent and analyst supervising the case together day-to-day, and included lawyers from three different levels in the general counsel's office. I frequently referred to this collection of twelve people as "the Midyear team." I meet with the "line-level" agents, analysts, and support folks except to periodically thank them for their hard work.
Over the next eighteen months, I relied on the twelve-member Midyear team to help me make decisions on the case — though the ultimate decisions would be mine. Some members moved in and out as a few senior executives retired, but the group remained a collection of very bright people with strong personalities ....
(Ibid, page 167, emphasis added)
In other words, about 20 officials -- assembled by FBI Counterintelligence -- were examining Clinton's e-mails, and another 12 officials -- assembled by Comey himself -- were dealing with legal and other issues. In sum, more than 30 FBI officials were involved in the Midyear Exam investigation that was conducted by the FBI Counterintelligence Division for about 18 months.
During those 18 months, many of those 30+ participants surely remarked in conversations among themselves that it was not fair to investigate all of Democrat candidate Clinton's e-mails whereas Republican candidate Trump was not being investigated at all. In response to such remarks, the truth was told that Trump was being investigated too. Various details were told.
During those 18 months, many more FBI officials learned that FBI Counterintelligence had been investigating Trump for many years.
Perhaps one such FBI official decided in early May 2017 to inform President Trump that FBI Counterintelligence had been investigating him for many years -- and that Comey knew it.