As mentioned in #488 we have DownloadBatchStatusCallback that returns a copy of an underlying DownloadBatchStatus, we then need to grab the "real" instance from the Map in order to update the notificationSeen when dispatching notifications.
Ideally we should make the cloning that we perform more explicit. At the moment we do not clone in the File downloader but we do in the batch, this is done for a reason but it is not documented. FYI it's done because the file callback is owned by us but the callback from the DownloadBatch forwards to the client.
We are forced to use DownloadBatchStatus in places where we require InternalDownloadBatchStatus.
Solution
Make the cloning more explicit, perhaps collapsing to the top most level, closest to the client.
Create a better callback system where internal classes can use InternalDownloadBatchStatus and where clients use the lesser DownloadBatchStatus.
Problem
As mentioned in #488 we have
DownloadBatchStatusCallback
that returns a copy of an underlyingDownloadBatchStatus
, we then need to grab the "real" instance from theMap
in order to update thenotificationSeen
when dispatching notifications.Ideally we should make the cloning that we perform more explicit. At the moment we do not clone in the
File
downloader but we do in the batch, this is done for a reason but it is not documented. FYI it's done because the file callback is owned by us but the callback from theDownloadBatch
forwards to the client.We are forced to use
DownloadBatchStatus
in places where we requireInternalDownloadBatchStatus
.Solution
Make the cloning more explicit, perhaps collapsing to the top most level, closest to the client.
Create a better callback system where internal classes can use
InternalDownloadBatchStatus
and where clients use the lesserDownloadBatchStatus
.