Skip to content

Stacktrace when loading old AccountDao in static_url Emoji property #2062

@sebastianwagner

Description

@sebastianwagner

Describe the bug
After upgrading the APP to 3.3.0 Pachli instantly produces a stack trace when it had an old account with custom Emojis cached.

To Reproduce
Steps to reproduce the behavior:

  1. Install some old Pachli version. Probably before bac7784
  2. Configure an account e.g. with social.bau-ha.us
  3. Upgrade to 3.3.0 (fdroid)
  4. Open app

Expected behavior
Maybe fallback to "" for those entites or migrate them.
core/database/src/main/kotlin/app/pachli/core/database/AppDatabase.kt

Versions
Some older pachli version from ca. March 2025
and 3.3.0 from fdroid

Additional context
I think that the cache cleanup after the removal of this @Json(name = "static_url") was insufficient when having bigger version jumps as I had.
While I don't know if moshi can deal with default values this could happen to a lot of entites changed.

The stacktrace abbreviated:

  • JsonDataException Required value 'staticUrl' missing at $[1]
  • .EmojiJsonAdapter.fromJson 2x
  • moshi NullSafeJsonAdapter
  • moshi CollectionJsonAdapter (I suspect EmojisEntity or List<PachliAccount> here)
  • JsonAdapter.fromJson
  • pachli Converters.s (:28 ?)
  • .dao.AccountDao_Impl.j (:114)
  • ...
  • some .room suspending logic

For me I just cleared the app data to resolve the issue.

Affirmation
I have checked other issues for this project (open and closed) and I cannot find one that matches the problem I am reporting. - yes

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions