Skip to content

[BUG] Can't manually retry a failed camera upload #3417

@selius

Description

@selius

Hi,

It looks like in one of the recent versions you guys started to use content:// URIs instead of local paths to handle camera uploads.
This works fine, but when an upload fails for some reason (like, the server is unavailable or no permissions to write to the upload directory), clicking on the upload in the Uploads list to retry it shows a "The file was not found in the local file system" message and does nothing.

From my quick debugging session, I found out that it happens because the code in the OnClickListener that's set in ExpandableUploadListAdapter.getView still expects the source path to be local and uses File.exists on it:

 view.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { File file = new File(upload.getLocalPath()); if (file.exists()) { TransferRequester requester = new TransferRequester(); requester.retry(mParentActivity, upload, false); refreshView(); } else { Snackbar snackbar = Snackbar.make( v.getRootView().findViewById(android.R.id.content), mParentActivity.getString(R.string.local_file_not_found_toast), Snackbar.LENGTH_LONG ); snackbar.show(); } } });

Although I fixed it for myself by also trying to pass the path to DocumentFile.fromSingleUri, but I don't think I have enough overall knowledge of the project to suggest a good PR for this, so just letting you guys know.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions