As the USB code stands, we have a race between printer preferences being synced into memory and USB device events happening.
In particular, if a user logs in with a USB printer connected, and the printer detector code searches for a matching existing printer before the preferences are synced into memory, it will fail to find a match, and will then add a duplicate printer to the user preferences.
There is no reliable way to say "hey, we've synced all preferences", as user preference changes can occur from other devices during a session, etc.
Possibly just changing Printer::id to be something deterministically generated from the URI in the case of a USB printer would be sufficient to fix this, but better understanding of the sync system is needed to make sure.
Comment 1 by justincarlson@chromium.org
, Mar 30 2017