When using the EPiServer.Web.Routing.UrlResolver.GetUrl method to get the url of multiple content versions (published and previous published) of the same Commerce content it always return the same url. The url of first content version (content link id and work id) used in EPiServer.Web.Routing.UrlResolver.GetUrl will be the url that is returned from the rest.
This is not an issue with CMS content. Here we get the correct url for each different content version.
I did a test in latest version (Episerver.Commerce 12.16.0) of the Quicksilver demo-site.
Did the same for CMS content.
The results can be seen here:
https://imgur.com/a/gr0ol53 (top image)
As you see in the image then we get the correct url for each version of the CMS content, but for the Commerce content we get the same even though that the RouteSegment is correct and different in each of the content versions.
As mentioned above it is the first content version retrived that decides it. If I recycle the app pool and changes the method to get the content versions in .Reverse() then this is shown.
https://imgur.com/a/gr0ol53 (buttom image)
A bug or?
I have time to look into the ticket today, and I can confirm it's a bug. A fix will be in upcoming version (likely 12.17)
Thanks Quan :)