tonyofrancis / Fetch

The best file downloader library for Android
https://www.meta.stackoverflow.com/tags/fetch2
Apache License 2.0
1.63k stars 328 forks source link

Feth listener onComplete() called twice #661

Open wahyurama-creator opened 10 months ago

wahyurama-creator commented 10 months ago

Why fetch listener called more than one time? I try save to database, but i see in my database have twice same data.

override fun onCompleted(download: Download) { viewModel.canGoBack.value = true viewModel.setButtonProperties(ProductStatusState.ReadyForRead) binding.apply { tvOfferSelected.text = getString(R.string.text_btn_download_success) val percentageDownload = "${download.progress}%" tvTotalPrice.text = percentageDownload } extractZipFile(applicationContext, viewModel.itemId, zipKey, fileType) saveItemToDatabase(download) }

image

LunevNF commented 4 months ago

Same problem and can't to resolve this issue normally (not ugly way).