Description
When attempting to fetch files from a repository that contains no data, the API returns a 500 Internal Server Error instead of a graceful empty response.
Endpoint
GET /api/groups/{groupId}/repos/{repoId}/media
Expected Behavior
The API should return an empty list [] indicating the repository is empty, rather than a server-side exception.
Actual Behavior
The request fails after 5 retries with a DHT-related error.
Error Message:
[src/error.rs:31] AppError occurred: Unable to get DHT value for repo root hash after 5 retries. Repo may be empty or hash not yet published to DHT.
Logs & Stack Trace
[src/error.rs:31] AppError occurred: Unable to get DHT value for repo root hash after 5 retries. Repo may be empty or hash not yet published to DHT.
<-- 500 Internal Server Error http://localhost:8080/api/groups/VLD0.../repos/...
content-length: 135
content-type: application/json
date: Sun, 22 Feb 2026 21:32:22 GMT
"Something went wrong: Unable to get DHT value for repo root hash after 5 retries. Repo may be empty or hash not yet published to DHT."
<-- END HTTP (135-byte body)
java.io.IOException: Something went wrong: Unable to get DHT value for repo root hash after 5 retries.
at net.opendasharchive.openarchive.services.snowbird.service.RetrofitAPI.safeApiCall(RetrofitAPI.kt:44)
at net.opendasharchive.openarchive.services.snowbird.service.RetrofitAPI.access$safeApiCall(RetrofitAPI.kt:25)
at net.opendasharchive.openarchive.services.snowbird.service.RetrofitAPI$safeApiCall$1.invokeSuspend(RetrofitAPI.kt:15)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
at android.os.Handler.handleCallback(Handler.java:1095)
at android.os.Handler.dispatchMessage(Handler.java:135)
at android.os.Looper.loopOnce(Looper.java:297)