Skip to content

Basic 2.42 support for EFH#1064

Draft
MatiasArriola wants to merge 6 commits into
developmentfrom
feature/v42-support-efh
Draft

Basic 2.42 support for EFH#1064
MatiasArriola wants to merge 6 commits into
developmentfrom
feature/v42-support-efh

Conversation

@MatiasArriola
Copy link
Copy Markdown
Contributor

@MatiasArriola MatiasArriola commented May 14, 2026

📌 References

📝 Implementation

  • Upgrade @eyeseetea/d2-api from 1.16.0 to 1.21.0 and move the app typings/imports from DHIS 2.36 to 2.40 to support EFH / DHIS 2.42.
  • Refactor D2 model/schema access to use shared helpers (getApiModel, getModelSchema) so runtime lookups keep working with the newer d2-api typing model.
  • Update current user handling to use top-level username and userRoles instead of userCredentials.*, which is required by newer DHIS versions.
  • Adapt metadata, sync, permissions and package import flows to the new user shape and to the updated d2-api exports.
  • Update tracker/events/TEI repositories to use the new tracker types and keep TEI/event synchronization working with the 2.40 API surface.
  • Add compatibility fixes around metadata handling:
    • fallback to top-level userRoles in metadata transformations
    • use code:eq:default as a temporary workaround when retrieving default metadata objects
    • keep dataset payload building compatible with default category option combo handling
  • To fetch Event files, use /tracker/events instead of /events which is deprecated in v36+ and removed in v42
  • Update UI summary/include-exclude screens to resolve model schemas through the new helpers instead of direct api.models[...] access.
  • Stabilize tests after the d2-api upgrade by forcing fetch through the XHR polyfill so Mirage/Pretender can still intercept requests, and by removing brittle assertions that depended on metadata fetch call order.
  • Add stricter Yarn security settings in .yarnrc.yml.

📹 Screenshots/Screen capture

  • N/A

🔥 Is there anything the reviewer should know to test it?

  • Marked as Draft as I consider more testing is needed, only basic EFH operations were tested.
  • No update to d2-api v42 yet, I initially upgraded to 1.21 as a transitory step, but basic features seem to work, so it is worth considering whether to implement full upgrade here.
  • This branch drops support for versions < 40. A thing to consider, if we want to provide support we might need to bring back the userCredentials handling.
  • Regression test the app against a DHIS 2.40 / EFH environment, especially:
  • login and current user resolution
  • metadata selection and sync summary rendering
  • metadata syncs including sharing settings, users and user roles
  • TEI and event sync flows
  • package import flow
  • Verify that default metadata objects are still excluded correctly during metadata sync.

📑 Others

  • Any change in the GUI library? If so, what branch/PR?
    No.

  • Any change in the D2 Api? If so, what branch/PR?
    No backend/API repo changes in this PR. This branch only upgrades the app dependency to @eyeseetea/d2-api@1.21.0.

Update d2-api usage to the 2.40 typed API surface and centralize d2-api type exports through the local wrapper.
Remove userCredentials usage.
Adjust tracker event and tracked entity repositories for the newer tracker response shapes, and model schema access patterns. Update metadata/model helpers and UI summary components to use the wrapper helpers instead of indexing d2-api models directly.
… 40)

fix: mirage tests fetch interception after d2-api upgrade
fix: MetadataPayloadBuilder tests to not depend on call order
fix: userRoles transformation to fallback to top-level userRoles if not under userCredentials
@bundlemon
Copy link
Copy Markdown

bundlemon Bot commented May 14, 2026

BundleMon

No change in files bundle size

Groups updated (1)
Status Path Size Limits
Build Folder
./**/*
2.76MB (+654B +0.02%) +20%

Final result: ✅

View report in BundleMon website ➡️


Current branch size history | Target branch size history

/events api endpoints are deprecated since DHIS 36 and removed in 42
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