DeviceId icon indicating copy to clipboard operation
DeviceId copied to clipboard

Mistake in migration guide?

Open derekantrican opened this issue 3 years ago • 2 comments

The migration guide in the readme states that for AddOSInstallationID (on mac) the equivalent in v6+ should be AddSystemDriveSerialNumber but - looking at the v5 & v6 implementations I think the README should state the equivalent is actually AddPlatformSerialNumber.

AddOSInstallationID v5:

https://github.com/MatthewKing/DeviceId/blob/fd2fb79be80cbb3130d3df94e2ceed4d03514132/src/DeviceId/DeviceIdBuilderExtensions.cs#L186-L189

AddPlatformSerialNumber v6:

https://github.com/MatthewKing/DeviceId/blob/814e752699071e756cf0b1db55252367cd60675b/src/DeviceId.Mac/MacDeviceIdBuilderExtensions.cs#L28

The commands executed are identical between these two (and not in AddSystemDriveSerialNumber)

derekantrican avatar May 29 '22 05:05 derekantrican

Also, did the default formatter change in v6+?

If I do the following in v5 and v6:

Using the ExampleCustomFormatter from here to print out the raw values.

Console.WriteLine(new DeviceIdBuilder().AddOSInstallationID().UseFormatter(new ExampleCustomFormatter()));
Console.WriteLine(new DeviceIdBuilder().AddSystemDriveSerialNumber().UseFormatter(new ExampleCustomFormatter()));
Console.WriteLine(new DeviceIdBuilder().AddOSInstallationID().AddSystemDriveSerialNumber());

I get essentially (values simplified because I don't want to find and copy down the actual values):

v5:

  • "A"
  • "B"
  • "C"

v6:

  • "A"
  • "B"
  • "D"

So the raw value is getting retrieved the same between v5 & v6 but the default formatter must have changed. If this is the case, I would suggest adding it to the migration guide (as I don't see anything about it on there).

derekantrican avatar May 29 '22 05:05 derekantrican

Thanks, I'll need to have a look at the migration guide to double-check everything.

The default formatter did change in V6. This is mentioned in the formatting section but not in the migration guide. I'll add it to the migration guide as well when I get some time.

MatthewKing avatar May 29 '22 08:05 MatthewKing

Think I've fixed up the migration guide now, too. Better late than never, I guess.

MatthewKing avatar Nov 22 '22 21:11 MatthewKing