AccountTracker has an AccountIds struct that stores information about Gaia accounts, supposedly the account ID, gaia ID, and email. However, it turns out that on non-ChromeOS platforms AccountTracker is populating the email field with the Gaia ID. The reason is that on notification that an account was added (via O2TS::Observer::OnRefreshTokenAvailable()), AccountTracker::StartTrackingAccount() creates a new AccountIds struct with both the account ID and email fields being populated from the account ID that was passed via OnRefreshTokenAvaiable()). On ChromeOS the account ID is the email address; however, on non-ChromeOS it is the Gaia ID.
This then extends to any clients of AccountTracker. In particular, GCMAccountTracker observes AccountTracker and takes its view of accounts' email addresses from AccountTracker's view. Thus, GCMAccountTracker's AccountInfo email field also stores the Gaia ID on non-ChromeOS.
This should be cleaned up one way or another, as it's just wrong in the codebase as it stands. Is the email address perhaps just unimportant in this context, given that this bug has existed for goodness knows how long without detection?