-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixes: site monitor prevent webview reload #20077
Fixes: site monitor prevent webview reload #20077
Conversation
Generated by 🚫 Danger |
📲 You can test the changes from this Pull Request in WordPress by scanning the QR code below to install the corresponding build.
|
📲 You can test the changes from this Pull Request in Jetpack by scanning the QR code below to install the corresponding build.
|
…load # Conflicts: # WordPress/src/main/java/org/wordpress/android/ui/sitemonitor/SiteMonitorParentActivity.kt # WordPress/src/main/java/org/wordpress/android/ui/sitemonitor/SiteMonitorTabViewModel.kt
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## trunk #20077 +/- ##
==========================================
+ Coverage 40.16% 40.26% +0.10%
==========================================
Files 1457 1455 -2
Lines 66980 66950 -30
Branches 11065 11051 -14
==========================================
+ Hits 26904 26959 +55
+ Misses 37587 37501 -86
- Partials 2489 2490 +1 ☔ View full report in Codecov by Sentry. |
webServerViewModel.start(SiteMonitorType.WEB_SERVER_LOGS, SiteMonitorTabItem.WebServerLogs.urlTemplate, site) | ||
} | ||
|
||
fun getUiState(siteMonitorType: SiteMonitorType): MutableState<SiteMonitorUiState> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it be better to return here State instead of MutableState? I guess the consume is not going to modify the received state. WDYT @AjeshRPai ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice catch @pantstamp, You are right. Its better to return state here. Done in f6633cf
private val _uiState = MutableStateFlow<SiteMonitorUiState>(SiteMonitorUiState.Preparing) | ||
val uiState: StateFlow<SiteMonitorUiState> = _uiState | ||
private val _uiState = mutableStateOf<SiteMonitorUiState>(SiteMonitorUiState.Preparing) | ||
val uiState = _uiState |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a reason why we do not return here state instead of mutable state like this?
val uiState: State<SiteMonitorUiState> = _uiState
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are right @pantstamp , I have updated the variable type as suggested in this commit fb3c6b9
Great work @AjeshRPai ! I really like the fact that you got rid of the fragment. I will take a look at the glitch to see what I can find. |
@AjeshRPai the first time that we launch the site monitoring screen, I can see the Is this what we want? I think that we should track this event even the first time. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@AjeshRPai - Thanks for finding a solution to the reload issue. 👏
With the exception of the few comment @pantstamp left, I am ready to give this a 👍 . In addition, I added a fix for the glitch. Please let me know what you think.
@AjeshRPai @pantstamp - 🤔 We already capture |
Generated by 🚫 dangerJS |
Fixes
#20067
Description
This PR fixes the issue of reloading of the webviews in site monitoring activity when the tabs are selected again.
Screen_recording_20240131_151636.webm
Pending issues
To Test:
Prerequisite
◐ Toggle the
site_monitoring
flagMe
→App Settings
→Debug settings
→Remote Feature Flags
RESTART THE APP
buttonSite monitor webviews are not re-loaded when selected again
🔵 Tracked: site_monitoring_screen_shown
`
Regression Notes
What I did to test those areas of impact (or what existing automated tests I relied on)
Manual testing
What automated tests I added (or what prevented me from doing so)
N/A
PR submission checklist:
RELEASE-NOTES.txt
if necessary.UI Changes testing checklist: