Skip to content

Status/ServiceUpdate fetcher > disable clear all tasks on screen leave - #353

Merged
mmathieum merged 20 commits into
masterfrom
mm/disable_clear_all_task_on_pause_leaving_screen
Jul 4, 2026
Merged

mmathieum merged 20 commits into
masterfrom
mm/disable_clear_all_task_on_pause_leaving_screen

Conversation

@mmathieum

@mmathieum mmathieum commented Jul 1, 2026 •

Copy link
Copy Markdown
Member

onPause()/onPageSelected() can request cancelling valid status/service update fetchers

Requires:

onPause()/onPageSelected() can request cancelling valid status/service update fetchers
@mmathieum mmathieum self-assigned this Jul 1, 2026
@mmathieum mmathieum linked an issue Jul 1, 2026 that may be closed by this pull request
@github-actions

github-actions Bot commented Jul 1, 2026 •

Copy link
Copy Markdown

Qodana for JVM

It seems all right 👌

No new problems were found according to the checks applied

☁️ View the detailed Qodana report

Contact Qodana team

Contact us at [email protected]

@mmathieum mmathieum added bug P2 🔼 Priority 2: High labels Jul 1, 2026
@mmathieum

Copy link
Copy Markdown
Member Author

/gemini review

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request transitions lifecycle-based list adapter visibility management from onResume/onPause to onStart/onStop across multiple fragments, renaming the adapter methods to onVisible and onInvisible. It also introduces a F_CLEAR_ALL_TASKS_ON_LEAVING_SCREEN feature flag to conditionally clear status and service update tasks, marking the corresponding clearAllTasks methods as discouraged. The review feedback highlights a potential issue in ABFragment where a LiveData observer is registered inside onResume(), which can cause duplicate observers and memory leaks upon multiple pause/resume cycles.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

@mmathieum

Copy link
Copy Markdown
Member Author

/gemini review

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request refactors the status and service update loading mechanism by replacing 'find' operations with 'triggerRefresh' and updating timestamp tracking. It also transitions list adapters from using onResume/onPause to onVisible/onInvisible across multiple fragments. The review feedback highlights that for parent fragments (FavoritesFragment, HomeFragment, PickPOIDialogFragment, and POIFragment), the onVisible calls should be placed in onStart() instead of onResume() to ensure lifecycle symmetry and align with the guidelines defined in POIArrayAdapter.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

@mmathieum

Copy link
Copy Markdown
Member Author

/gemini review

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request refactors status and service update loading by renaming "find" operations to "triggerRefresh" and updating associated timestamp tracking. It also transitions adapter lifecycle methods from onResume/onPause to onVisible/onInvisible, adjusts fragment lifecycle calls accordingly, and integrates POIRepository to manage the user preference for showing a list instead of a map for route direction stops. Feedback is provided regarding an invalid sort method call on ServiceUpdates in POIManager.java, which should be replaced with sortWith.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

mmathieum added 6 commits July 2, 2026 13:48
Bug was probably related to status+service update loaders > clear all task onPause and no notifyDataSetChanged() in onResume/onVisible after
@mmathieum
mmathieum marked this pull request as ready for review July 4, 2026 16:37

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request refactors the status and service update loading mechanism to use a unified trigger-refresh approach, renames lifecycle-related adapter methods from onResume/onPause to onVisible/onInvisible, and introduces preference updates for route direction display modes. Key feedback highlights a potential ClassCastException when casting activity to MainActivity (since NextMainActivity is also active), a performance concern where getStatus() triggers refreshes continuously when inFocus is true, a compilation issue due to calling sort instead of sortWith on ServiceUpdates, and a recommendation to use the already-cast rds variable in POIViewHolderUtils.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

@mmathieum

Copy link
Copy Markdown
Member Author

/gemini review

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request refactors the status and service update loading mechanism, replacing "find" operations with "triggerRefresh" and tracking timestamps to the minute. It also renames adapter lifecycle methods from onResume/onPause to onVisible/onInvisible across multiple fragments, and introduces a POIRepository method to persist whether a route direction should show a list instead of a map. Feedback was provided on POIManager.java to use sortWith instead of sort since ServiceUpdates does not support the standard sort method.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

@mmathieum
mmathieum merged commit 05a6804 into master Jul 4, 2026
11 checks passed
@mmathieum
mmathieum deleted the mm/disable_clear_all_task_on_pause_leaving_screen branch July 4, 2026 19:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug P2 🔼 Priority 2: High

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Paused screen are still visible > keep updating UI data...

1 participant