Skip to content

feat(formulus): add profiles with in-app switching - #931

Merged
r0ssing merged 9 commits into
devfrom
profiles
Sep 25, 2026
Merged

r0ssing merged 9 commits into
devfrom
profiles

Conversation

@Ndacyayisenga-droid

@Ndacyayisenga-droid Ndacyayisenga-droid commented Sep 22, 2026 •

Copy link
Copy Markdown
Member

Summary

  • Add profiles with legacy Default migration, profile-owned data and credentials, connection locking, and a Profiles UI.
  • Switch A→B→A without restarting: retain one WatermelonDB instance per visited profile, quiesce work, and recover safely from ambiguous registry writes or failed opens. Defer deletion of prepared databases until a real cold start; no WatermelonDB source changes.
  • Load one bundled Formplayer on both platforms, guard draft finalization against stale async writes, and warn that profiles are not a security boundary. Only connect to trusted servers and install trusted custom apps.

Validation

  • Formulus lint and format check; Jest: 62 suites, 485 tests passed.
  • Formplayer lint, format check and production build; Vitest: 37 files, 246 tests passed.
  • Android assembleDebug could not run here: NDK 27.0.12077973 is not configured. iOS/on-device validation remains required. Separate public-docs updates are pending in the docs repository.

Manual release checks

  1. On Android and iOS, upgrade an install with existing observations/drafts, then create B and switch A→B→A repeatedly without closing the app. Check observation reads/writes, same-URL connections, sync, and custom apps; confirm profile data remains distinct.
  2. Delete active and inactive profiles; check the survivor works immediately and deleted data is cleaned up after a real cold launch. Try switching during an open form or active sync and confirm it is blocked safely.
  3. On iOS specifically, open the bundled Formplayer and verify photo/audio/video/signature previews and legacy drafts/sticky values offline after switching. The broader WKWebView read grant is not yet device-verified; treat failure as a release blocker.

Profiles organize host data but do not sandbox custom-app code or raw browser storage. Geolocation cache is intentionally global.

@Ndacyayisenga-droid
Ndacyayisenga-droid marked this pull request as draft September 22, 2026 21:51
@Ndacyayisenga-droid

Copy link
Copy Markdown
Member Author

Ping Ping @r0ssing

@r0ssing r0ssing changed the title Add profiles to formulus feat(formulus): add profiles with in-app switching Sep 25, 2026
@r0ssing

r0ssing commented Sep 25, 2026

Copy link
Copy Markdown
Member

Hi @Mishael-2584
Sorry for the quite substantial PR 🥲 - I believe the best way to handle this is if you could test it on a real device and then maybe do a brief AI assisted review of the code changes? Feel free to reach out so we can discuss - let's also include @Ndacyayisenga-droid as he implemented the first parts of this

@r0ssing
r0ssing self-requested a review September 25, 2026 13:36

@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.

LGTM ;-)

@r0ssing
r0ssing removed the request for review from Mishael-2584 September 25, 2026 14:03
@r0ssing
r0ssing marked this pull request as ready for review September 25, 2026 14:03
@r0ssing
r0ssing merged commit e2b2eb3 into dev Sep 25, 2026
16 checks passed
@r0ssing
r0ssing deleted the profiles branch September 25, 2026 14:03
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.

2 participants