Skip to content

Crash when saving image: java.io.FileNotFoundException: open failed: ENAMETOOLONG #1315

Description

@john99john

Checklist

  • I've already searched in existing issues and haven't found a similar problem reported.
  • I'm using the latest version of the app
  • This error caused the app to crash
  • This error is reproducible

Which category best fits this error?

Feed Sync

App version

0.16.2 (47)

Reproduction steps

  1. Open the application.
  2. Tap on any image/picture to view it in full-screen/separate view.
  3. Tap the "Save" (or download) button.
  4. The application crashes immediately, and the error screen appears.

Crash report

### Description
The application crashes and fails to save an image due to an overly long filename issue (`ENAMETOOLONG`). 

### Environment
- **App Version:** 0.16.2
- **Device:** Xiaomi selene
- **OS Version:** Android 11 (API 30)

### Steps to reproduce
1. Open the app.
2. Attempt to download/save an image with a long title or long URL-based name.
3. The app throws a `FileNotFoundException` and fails to save.

### Expected behavior
The app should automatically truncate or sanitize long filenames before saving to prevent OS-level errors.

### Error Log
<details>
<summary>Click to expand Stack Trace</summary>


java.io.FileNotFoundException: open failed: ENAMETOOLONG (File name too long)
	at android.database.DatabaseUtils.readExceptionWithFileNotFoundExceptionFromParcel(DatabaseUtils.java:151)
	at android.content.ContentProviderProxy.openAssetFile(ContentProviderNative.java:704)
	at android.content.ContentResolver.openAssetFileDescriptor(ContentResolver.java:1816)
	at android.content.ContentResolver.openFileDescriptor(ContentResolver.java:1631)
	at me.ash.reader.infrastructure.android.AndroidImageDownloaderdownloadImage2.invokeSuspend(AndroidImageDownloader.kt:181)
	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:9)
	at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:112)
	at kotlinx.coroutines.internal.LimitedDispatcher\$Worker.run(LimitedDispatcher.kt:8)
	at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:3)
	at kotlinx.coroutines.scheduling.CoroutineScheduler\$Worker.run(CoroutineScheduler.kt:93)
	Suppressed: kotlinx.coroutines.internal.DiagnosticCoroutineContextException: [StandaloneCoroutine{Cancelling}@797be09, Dispatchers.Main.immediate]


</details>

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinguntriagedThis issue hasn't been triaged yet

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions