The problem is that Darktable imports the JPG and the CR2 as two distinct files, and yes, I like the idea of DT still importing the JPG, but they should be grouped. While I have no clue how to fix this in the importer, it seems to me a simple way is to fix this directly in the DB.

But they were imported from a Shotwell directory, and I think that's part of the problem. In fact, sometimes there were three images for the RAW: the one from the camera, and another one generated by shotwell (!), which was a problem for a time in Shotwell (see http://redmine.yorba.org/issues/4261).

So this is not about a "bug" in Darktable, but more a way of cleaning photos that may have duplicated, whatever the reason. I am also considering extending this tool to actually delete JPG images that are copies of RAW files or simply duplicates.