Nuke icon indicating copy to clipboard operation
Nuke copied to clipboard

ImageRequest userInfo dictionary `Any` type for value allows unsupported types for imageIdKey

Open sean-escendant opened this issue 1 year ago • 2 comments

My project is using signed URLs for images and Nuke 12.4. I followed the documentation to use a custom image id key. Initially I had passed a URL, with query parameters stripped, as the custom key but testing showed that the cache wasn't working as expected. Only when I changed the key to a String, as in the documentation example, it started working as expected.

It seems some trade offs were made in the API design from Nuke 9 to 10 which introduced this, hopefully you can find a way to keep the API strongly typed otherwise a clear notice in the documentation as to what are the supported types for imageIdKey.

sean-escendant avatar Mar 17 '24 13:03 sean-escendant

Hey, @sean-escendant. Thanks for raising this. I think it's a valid concern, and this change also had other implications: a slight impact on performance and potentially higher memory use if one of the user info keys is used.

How would you suggest approaching it?

kean avatar Mar 23 '24 13:03 kean

I'm planning to work on version 13.0 soon, and it would be a good time to introduce any breaking changes if needed.

kean avatar Mar 24 '24 00:03 kean