Skip to content

fix(formplayer): auto-clear old drafts and don't trap users - #1050

Merged
r0ssing merged 5 commits into
OpenDataEnsemble:devfrom
najuna-brian:fix/formplayer-draft-cleanup
Nov 21, 2026
Merged

r0ssing merged 5 commits into
OpenDataEnsemble:devfrom
najuna-brian:fix/formplayer-draft-cleanup

Conversation

@najuna-brian

@najuna-brian najuna-brian commented Nov 20, 2026 •

Copy link
Copy Markdown
Member

What & Why

When a device's WebView localStorage filled up, Formplayer could no longer save drafts. Forms failed to open, Next stopped advancing, and Close kept users stuck in the form (#1048).

This PR:

  • Stores each draft in its own entry plus a small index, migrating the old formulus_drafts array on first access. One large draft can no longer block every other draft.
  • Removes drafts not edited for 7 days when a form opens. Drafts with a future or invalid date, and the draft of the observation being opened, are kept.
  • Lists drafts saved with another form version in the picker (labelled) instead of hiding them, and shows when each draft will be removed.
  • Moves legacy keys into profile storage instead of copying them, without needing room for two copies. A full storage now defers the migration instead of blocking the form.
  • Stops a failed draft save from blocking Next, opening a form, or a successful submit. Close now offers "Stay in form" / "Close anyway".

Type of Change

  • Bug fix
  • New feature / enhancement
  • Refactor / cleanup
  • Documentation
  • Chore / other

Component(s) Changed

  • formulus (React Native mobile app)
  • formulus-formplayer (form WebView UI)
  • synkronus (Go backend)
  • synkronus-cli (command-line client)
  • synkronus-portal (web admin UI)
  • desktop (Tauri app)
  • packages (tokens / components)
  • Documentation / DevOps / CI

Testing

  • Added/updated tests (migration, rollback, expiry guards, per-draft isolation)
  • Manually tested
  • Not applicable

Checklist

@r0ssing r0ssing left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great!

@r0ssing
r0ssing merged commit 137e1ca into OpenDataEnsemble:dev Nov 21, 2026
15 checks passed
@github-project-automation github-project-automation Bot moved this from Triage to Done in ODE Community Board Nov 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

[Formplayer] auto-clear old drafts so localStorage can't fill up

2 participants