Web client: importing a 1.8.0 data export crashes on an unknown UiStrings value ('ForYou') and applies nothing

Aperta
#2,796 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
1-2 giorni
Idoneità per principianti
42/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
kotlin

Direzione di ricerca

Start by tracing ImportDataPresenter.import(), then inspect ImportAppDatabasePresenter and ImportSettingsPresenter to see how database and settings imports handle unknown values. The issue does not identify relevant test files, so locate existing import tests before choosing a reproduction. Done means importing the supplied export no longer aborts without applying any data, and the failure is surfaced or handled clearly.

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

Descrizione

What happened

I exported my data from the iOS app (Settings → Data export, app version 1.8.0) and imported the JSON file on https://web.flareapp.moe. The import fails with a raw Kotlin exception shown to the user:

dev.dimension.flare.ui.model.UiStrings does not contain element with name 'ForYou'
at path $.tabSettingsV2.homeSlots[0].content.children[2].content.target.title.string

After that, neither the exported accounts nor the tab settings appear in the web client (account list is still empty).

Environment

  • Source of the export: Flare iOS 1.8.0 (App Store build), containing tabs from several platforms
  • Target: web client at https://web.flareapp.moe (Chromium, Windows)
  • Failing tab: xqt.featured (title UiText.Localized("ForYou")), alongside xqt.popular → "Popular"

Minimal reproduction (redacted)

Account ids, DID, protobuf data payloads and all credentials are replaced with placeholders.
In this trimmed file the failing tab is at index 0 of the group — in my original export it sat at index 2 of the mixed timeline group.

{
 "appDatabase": {
  "accounts": [
   {"account_key":{"id":"2222222222","host":"x.com"},
    "credential_json":"{\"redacted\":\"<credentials removed>\"}",
    "platform_type":"xQt","last_active":1700000000000,"sort_id":1}
  ]
 },
 "settings": {
  "appearanceBag": {"entries": {}},
  "appSettings": {"version":"1.8.0","refreshHomeTimelineOnLaunch":false,"rememberHomeTimelinePosition":true},
  "tabSettingsV2": {
   "homeSlots": [
    {"id":"mixed_timeline_system_home",
     "content":{"type":"group","source":"SystemHome","mergePolicy":"TimePerPage","children":[
       {"id":"xqt.featured:[email protected]",
        "content":{"type":"source","target":{
          "id":"xqt.featured:[email protected]","specId":"xqt.featured",
          "title":{"type":"dev.dimension.flare.ui.model.UiText.Localized","string":"ForYou"},
          "icon":{"type":"dev.dimension.flare.data.model.IconType.FavIcon","host":"x.com"},
          "data":"<redacted>",
          "ownerAccountKey":{"id":"2222222222","host":"x.com"}}}}
     ]}}
   ]
  }
 }
}

Analysis

  1. ImportDataPresenter.import() runs ImportAppDatabasePresenter and then ImportSettingsPresenter. UiText.Localized.string is a serialized UiStrings enum, so a value that the running build does not know makes kotlinx.serialization throw, and the whole import is aborted. There is no fallback to UiText.Raw / no per-tab skip.
  2. The currently deployed web build cannot know ForYou: the shipped /_app/immutable/assets/flare.*.wasm contains Featured, MastodonLocal, XQT, but zero occurrences of ForYou / Popular / WeiboFriendsCircle / xQt. So the deployed web build predates the August 2026 platform-id migration (XQT → xQt), while iOS 1.8.0 already writes the new ids.
  3. Even with a newer web build, the web client only bundles Bluesky / Mastodon / Misskey (web-shared/build.gradle.kts), so tabs belonging to platforms that aren't bundled (e.g. the X tab here) are not renderable there at all. Importing such a file into the web client is a dead end that currently surfaces as a crash instead of a clear message.

Suggested improvements

  • Make import forward-compatible: unknown UiStrings / unknown specId / unknown platformId should be skipped with a warning (or mapped to UiText.Raw(fallbackString)) instead of throwing and aborting the entire import.
  • Surface a human-readable error instead of the raw SerializationException (UiStrings does not contain element with name … at path $.tabSettingsV2…).
  • Skip accounts whose platform is not registered in the current build, and tell the user which ones were skipped.
  • Redeploy https://web.flareapp.moe from master — the deployed bundle is several months behind the app.

Side note on credentials

The export embeds plaintext credentials in credential_json (session cookies / access tokens for every connected account) in unencrypted JSON (see also #1677). It would help to warn about this in the export dialog and to offer a "settings/tabs only, no credentials" export, since the file looks like a harmless config dump.

Lingua principale
Kotlin
Stelle
1.7k
Fork
85
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

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 DimensionDev/Flare

Tutte le issue di DimensionDev/Flare

Issue simili

Altre issue su Kotlin

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.