Lua database.duplicate does not copy history stack
The GUI form of duplicate image copies the current image including its history stack into a new image. When I use the lua API darktable.database.duplicate() function, the resultant image is a duplicate of the original (unmodified) source image ... its history stack is not copied with it.
Not 100% clear on code path for the GUI but I think it is called via dt_control_duplicate_images_job_run() which, in turn, calls dt_image_duplicate() and then dt_history_copy_and_paste_on_image().
When I look at the lua code, it appears to only call dt_image_duplicate() and not the latter function. As there is no lua API for the history function, I'm at a loss at how to create a truly identical duplicate using lua (current workaround is to create a style from original and apply to the duplicate but that has some problems too -- see issue 11292)
I recognize changing the behavior of existing API function may not be possible for compatibility reasons, but if the history function could be exported as well (or alternatively, have an optional boolean copy history argument to database.duplicate() API) that would be useful to me and, I would think, others.