Update UnifiedAboutActivity.kt - #23154
Open
OneBitSailor wants to merge 2 commits into
Open
Conversation
Added check for possible invalid URLs or missing web browsers.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixed lifecycle and possible injection issues in UnifiedAboutActivity along side with implementing safe check for possible invalid URLs or missing external web browsers.
Description
Safe Dependency Injection: Ensured Dagger injection occurs before
super.onCreateto prevent lifecycle race conditions where the framework might try to restore state or fragments using fields before they are injected.Safe URL Interaction: Encapsulated the external URL launcher in a explicit
try-catchblock capturingActivityNotFoundException. This guarantees the app will not crash on low-end or highly restricted devices lacking a default web browser or when processed an invalid deep-link structure.Testing instructions
Test Case 1: Standard navigation and external link launching
Test Case 2: Error handling on missing browser or invalid URL
openExternalBlogUrlwith an invalid link schema or restricted destination.Use numbered lists for action steps and checkboxes for verifications.
Organise by test case title when there are multiple scenarios.
Self-Testing Checklist
UnifiedAboutActivitycorrectly resolves config settings provided by theUnifiedAboutViewModelregardless of whether the active authenticated user profile belongs to a WordPress.com account or a self-hosted Jetpack site.