Android: importing SQLite/ZIP directly from Proton Drive fails, while local import works

Aperta
#13,868 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
48/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
android, clojure
Ambito
backend, mobile

Direzione di ricerca

Start by tracing the Android import flow for SQLite and ZIP files, especially how it handles the selected document URI while the graph-name dialog is open. Compare the Proton Drive URI behavior with the same files selected from local storage. Done means both imports work from the provider, or an unsupported URI produces a clear actionable error.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Search first
  • I searched and no similar issues were found

Related issues:

What Happened?

Importing a Logseq DB graph directly from the Proton Drive Android
document provider fails.
I reproduced two failure modes:

  1. When importing db.sqlite directly from Proton Drive, Logseq displays
    the graph-name dialog. After entering a name and pressing Submit,
    nothing happens. The dialog remains open, and the graph is not added.
    Android also generates a crash report for the system
    Files/DocumentsUI component.
  2. When importing the official “SQLite DB + assets” ZIP directly from
    Proton Drive, Logseq reports:

    ZIP import failed: The requested file could not be read, typically
    due to permission problems that have occurred after a reference to
    a file was acquired.
    The same ZIP works correctly after it is downloaded to the phone's
    local storage under Pixel 8/Download.
    The locally imported graph opens correctly, its content is readable,
    and internal links work. Therefore, the ZIP and SQLite database do not
    appear to be corrupted.
    This appears to be related to handling an Android Storage Access
    Framework document URI from a cloud document provider. Logseq may be
    keeping the selected JavaScript File reference while asking for the
    graph name and reading it only later, after the temporary reference has
    become inaccessible.

Reproduce the Bug
SQLite import
  1. Install and configure Proton Drive on Android.
  2. Upload or synchronize a Logseq DB graph containing db.sqlite.
  3. Open Logseq.
  4. Open the three-dot menu.
  5. Select Import.
  6. Select SQLite.
  7. In the Android file picker, open Proton Drive.
  8. Select db.sqlite.
  9. Enter a name for the new graph.
  10. Press Submit.
    Result: the button has no visible effect, and the graph is not imported.
ZIP import
  1. On Logseq Desktop, select Export graph.
  2. Export SQLite DB + assets as a ZIP file.
  3. Make the ZIP available through Proton Drive.
  4. On Logseq Android, select Import.
  5. Select SQLite + assets (.zip).
  6. Select the ZIP directly from Proton Drive.
  7. Enter a graph name and submit.
    Result:
ZIP import failed: The requested file could not be read, typically due
to permission problems that have occurred after a reference to a file
was acquired.
Expected Behavior

Logseq should be able to read a file selected through an Android Storage Access Framework document provider such as Proton Drive.

If the selected URI provides only temporary access, Logseq should read or copy the file immediately after selection, before displaying the graph-name dialog.

If the provider cannot be supported, Logseq should display a clear and actionable error instead of leaving the Submit button unresponsive.

Screenshots

I can provide a screen recording if required.

Desktop or Mobile Platform Information

Device: Google Pixel 8 (shiba)
OS: GrapheneOS / Android 17
GrapheneOS release: 2026102101
Android build: CP3A.261005.005
Logseq Android: 2.0.2, official APK installed through Obtainium
Logseq Desktop: 2.0.2
Files/DocumentsUI package: version 37, target SDK 37
Proton Drive: 2.32.0

Additional Context

The Android crash report identifies the crashing process as the system Files/DocumentsUI component rather than Logseq:

type: crash
osVersion: google/shiba/shiba:17/CP3A.261005.005/2026102101:user/release-keys
package: com.android.documentsui:37, targetSdk 37
process: com.android.documentsui
java.lang.RuntimeException:
An error occurred while executing doInBackground()
Caused by: java.lang.StringIndexOutOfBoundsException:
begin 0, end -1, length 0
    at java.lang.String.substring(String.java:3040)
    at com.android.documentsui.Metrics.sanitizeMime(Metrics.java:472)
    at com.android.documentsui.picker.UpdatePickResultTask.doInBackground(
        UpdatePickResultTask.java:53
    )

This may indicate that Proton Drive returns an empty or invalid MIME type for db.sqlite. However, Logseq also receives a NotReadableError for the ZIP, and the same file works when selected from local storage.

The complete Android crash report is attached here: Error in Files 63e3f1a7e1d9.txt

This Issue is generated by GPT-5.6 sol and proofread by me.
Thank you and have a good day.

Are you willing to submit a PR? If you know how to fix the bug.
  • I'm willing to submit a PR (Thank you!)
Lingua principale
Clojure
Stelle
45.7k
Fork
2.9k
Merge medio
1g 19h
PR unite (30g)
131

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di logseq/logseq

Tutte le issue di logseq/logseq

Issue simili

Altre issue su Clojure

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.