When notify when this file has been downloaded is enabled and a share is downloaded publically the share does not get removed and the email is not sent.
Line 28 in FileService should be changed to :
if ((role is not None and flFile.role_owner_id != role.id) or user == None or user.id != flFile.owner_id) and flFile.notify_on_download and publicShareId is None:
That seems to fix it for me.
We've included your fix in v2.6. Thanks!