Skip to content

fix(android): preserve list state identity - #44

Merged
GenericJam merged 1 commit into
masterfrom
fix/android-list-state-identity
Aug 31, 2026
Merged

fix(android): preserve list state identity#44
GenericJam merged 1 commit into
masterfrom
fix/android-list-state-identity

Conversation

@GenericJam

Copy link
Copy Markdown
Owner

Summary

  • retain generated lazy-list state by canonical node identity when available
  • otherwise retain state by the stable event slot instead of the generation-tagged handle
  • reject negative unhandled sentinels so they cannot collide with valid slot 255
  • preserve scroll position across renders without growing the retained-state map per frame

Companion to GenericJam/mob#114.

Testing

  • 348 integration-inclusive tests
  • focused generator regression test
  • generated Android main and instrumentation Kotlin compilation
  • formatting, strict Credo, warnings-as-errors compilation, and diff checks
  • adversarial cross-repository review

Key generated lazy-list state by canonical node identity or event slot. Reject negative sentinel handles to avoid slot collisions.
@GenericJam

Copy link
Copy Markdown
Owner Author

Reviewed in lockstep with mob #114's revision on a physical Moto (generated probe from this branch, 8/8 instrumented tests on device incl. the new list-identity test). Approve — merging and releasing.

F1 verified fixed with the exact prior repro: id-keyed list retains {0,40} across 20 re-renders (was reset after one), slot-fallback list retains 56-63, two lists on one screen don't cross-contaminate, negative sentinel maps to null key (never SlotKey(255)), no per-frame map growth (Dalvik plateau flat under sustained 25ms re-render load), nav-clear intact. Version skew both ways is sane: this template + mob 0.7.37 degrades to exactly the old slot behavior; the mandatory-lockstep direction is old-template + new-mob, which is mob's changelog's problem and it says so.

Two notes for follow-up: (1) Mob's high-level :list DSL drops :id when lowering to lazy_list (lib/mob/list.ex:119), so real apps on :list take the slot-fallback path — proven solid, but the canonical-id path deserves a doc line and the DSL an :id passthrough (filing upstream); (2) the changelog entry dropped the blank line before [0.4.28] — fixed at release.

@GenericJam
GenericJam merged commit aff23f9 into master Aug 31, 2026
3 checks passed
@GenericJam
GenericJam deleted the fix/android-list-state-identity branch August 31, 2026 18:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant