Skip to content

feat: mobile-config — emit mobile_doctype + derive meta-refresh signal [review-only]#36

Open
nadge-sachin wants to merge 1 commit into
developfrom
feat/rf-mis-auth
Open

feat: mobile-config — emit mobile_doctype + derive meta-refresh signal [review-only]#36
nadge-sachin wants to merge 1 commit into
developfrom
feat/rf-mis-auth

Conversation

@nadge-sachin

Copy link
Copy Markdown
Collaborator

What & why

The mobile_control half of the mobile meta-refresh fix (companion: rf_mis PR dhwani-ris/frappe_rf_mis#59, + a project-end SDK change). Server field changes (hide / new / relabel) weren't reaching the app without a cache clear.

This PR (api/helpers/mobile_config.py, single commit 79a99d0)

  • Emit mobile_doctype in the config payload — the key the SDK actually reads (mobile_form_name.dart). The server only emitted mobile_workspace_item, so the signal never registered. mobile_workspace_item is kept for the server-side consumers (permissions.py).
  • Derive doctype_meta_modifed_at = MAX(modified) across the form + its child doctypes + Property Setters + Custom Fields, by reusing rf_mis.rf_mis.api.meta_override.compute_meta_modified (single source of truth with the meta stamp). Safe try/except fallback to the stored value.

Tech debt (flagged per review)

mobile_control now imports a helper from rf_mis — an inverted dependency (generic app → site app). Acceptable for now since mobile_control is feature-branch-only and ships alongside rf_mis; long-term the helper should move to a generic layer or be duplicated.

Status

  • Review-onlymobile_control is feature-branch-only and not merged until project end. Base is develop purely to give a clean single-commit diff; do not merge to develop. Retarget if you'd prefer a different base.
  • Validated end-to-end on device (child column hidden → gone on Sync + reopen, no cache clear). Helper unit-tested in the rf_mis PR.

📄 Full write-up + proof: https://claude.ai/code/artifact/bf2acb21-313f-4565-bb29-8424134fbda4

…d_at

Mobile meta changes (hidden/new/relabelled fields) now propagate without a
cache clear:
- emit mobile_doctype (the key the SDK reads) alongside mobile_workspace_item
- derive doctype_meta_modifed_at as MAX(modified) across the form + its child
  doctypes + Property Setters + Custom Fields (reuses rf_mis
  meta_override.compute_meta_modified, with a safe fallback)

@abhijitnairDhwani abhijitnairDhwani left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Reviewed the commit (79a99d0) — correct: emits mobile_doctype (the key the SDK actually reads) alongside mobile_workspace_item, and derives doctype_meta_modifed_at via rf_mis compute_meta_modified with a try/except fallback (single source of truth; tech debt noted re: the inverted generic->site dependency). NOT approving-to-merge: per our policy mobile_control stays on its feature branch (feat/rf-mis-auth) and is not merged to develop — this PR is a review surface only, so ignore the develop conflict. The change is good to keep on the feature branch and deploy with the rf_mis side.

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