I believe that priorty is established by the first inventor's notebook. The US was a "first to invent" country but has followed the ROW into a "first to file" mode. The first to invent still has right to use and practice their invention, I am pretty sure, but they cannot sue others for its use. That right would go to the patent holder even if they were not first to invent.
Corrections welcomed