Skip to content

fix: [ANDROAPP-7574] make navigation context safe #4829

Merged
xavimolloy merged 2 commits into
release/3.4.1from
ANDROAPP-7574
May 5, 2026
Merged

fix: [ANDROAPP-7574] make navigation context safe #4829
xavimolloy merged 2 commits into
release/3.4.1from
ANDROAPP-7574

Conversation

@xavimolloy
Copy link
Copy Markdown
Collaborator

…nt is attached

Description

Link the JIRA issue.

Please provide a clear definition of the problem and explain your solution.

Copilot AI review requested due to automatic review settings April 24, 2026 07:11
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR addresses ANDROAPP-7574 by making TEI dashboard navigation and UI interactions safer when triggered from background work, reducing crashes caused by using a Fragment context after it’s no longer attached.

Changes:

  • Switch TEIDataPresenter UI calls to run on the UI dispatcher via withContext(dispatcher.ui()).
  • Guard TEIDataFragment navigation/dialog entry points with if (!isAdded) return to avoid requireContext() / FragmentManager usage when detached.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
app/src/main/java/org/dhis2/usescases/teiDashboard/dashboardfragments/teidata/TEIDataPresenter.kt Moves navigation and message UI calls onto the UI dispatcher while running repository/use-case work on IO.
app/src/main/java/org/dhis2/usescases/teiDashboard/dashboardfragments/teidata/TEIDataFragment.kt Adds attachment checks before starting activities or showing the org unit selector dialog.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copilot AI review requested due to automatic review settings May 5, 2026 08:42
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review is ineligible. To be eligible to request a review, you need a paid Copilot license, or your organization must enable Copilot code review.

@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented May 5, 2026

@xavimolloy xavimolloy merged commit 87d4c31 into release/3.4.1 May 5, 2026
6 checks passed
@xavimolloy xavimolloy deleted the ANDROAPP-7574 branch May 5, 2026 09:39
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.

4 participants