-
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
Reverting paging3 migration #14968
Reverting paging3 migration #14968
Conversation
You can trigger optional UI/connected tests for these changes by visiting CircleCI here. |
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.
Left a few questions while comparing the diff with the other PR.
Note that I'm no Android developer and only blindly compared the diff with other PR, or compared what was removed with what was commented, without trying to decipher the Android logic behind it, so those are merely questions and incentives to double-check, but might be false positives.
Even if there are differences in the two diffs that are correct and make sense because develop and release/17.6 differ, I think it would still be valuable to ensure the code that is marked as +added but commented out matches the code that is marked as -removed in the diff, otherwise this will lead to regressions when we uncomment them later.
return commentListItems | ||
} | ||
/** | ||
* Temporarily commented out until migration between Paging 2 and 3 is sorted out. |
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.
nit: worth a reference to the Slack discussion, Sentry issue, and past PRs here to track it when we get back to it? 🤔
override fun onDestroyView() { | ||
super.onDestroyView() | ||
binding = null | ||
} |
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.
I don't see this part being added in the diff of the cherry-picked commit – https://github.com/wordpress-mobile/WordPress-Android/pull/14949/files#diff-d3f669617284dbfa52ea7b4aeb770607c0f206258a309d4140a8a417153a1b02L65, but I see it was already there back then tho.
Just double-checking this re-addition is thus intentional given this was not part of the release/17.6 branch when we did 17.6 back then.
val commentListItems = commentListItemPager.flow | ||
.map { pagingData -> | ||
pagingData.map { commentModel -> | ||
val toggleAction = ToggleAction(commentModel.remoteCommentId, this::clickItem) | ||
val clickAction = ClickAction(commentModel.remoteCommentId, this::toggleItem) | ||
Comment( | ||
remoteCommentId = commentModel.remoteCommentId, | ||
postTitle = commentModel.postTitle, | ||
authorName = commentModel.authorName, | ||
authorEmail = commentModel.authorEmail, | ||
body = commentModel.content, | ||
avatarUrl = "", | ||
isPending = commentModel.status == CommentStatus.UNAPPROVED.toString(), | ||
isSelected = false, | ||
clickAction = clickAction, | ||
toggleAction = toggleAction | ||
) | ||
} | ||
.insertSeparators { before, after -> | ||
when { | ||
before == null -> SubHeader("Date Sub Header", -1) | ||
// TODO add the logic for determining if subheader is necessary or not | ||
else -> null | ||
} | ||
} | ||
} |
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.
Side note that the diff is slightly different here from what was removed in the other PR. Probably expected given this part of the code like changed between release and develop, but just wanted to highlight this to double-check that the different code being removed did not have side effects that the original didn't have.
Also, that means that the code that is actually added and commented out on the following lines 18-73 does not match what was removed, so when we get back to this later to "revert this revert" and try to get back to migrating to paging 3, there is a risk that we would just uncomment the lines 18-73 (instead of reverting this PR) and land in a different state of the code that what was expected, introducing regressions and bugs or behavior changes that were fixed by the new code that was removed above but were still present in the code that was commented below
@@ -0,0 +1,90 @@ | |||
package org.wordpress.android.ui.comments.unified |
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.
This whole file was not part of the other PR. Is this file addition expected there?
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.
as mentioned in the PR description
NOTE: code that was cherry picked from 17.7 was slightly ahead respect the original code in 17.6. This required adding the UnifiedCommentListItemDecoration that was added in 17.7. All this code is behind a feature flag, so as far as it compiles and we confirm the fix works we should be ok.
being the code behind a feature flag AFAIU if it compiles it should not have an impact since it is not run and we removed the dependency on the paging 3 lib (happy to have your thoughts on this as well @ashiagr 🙇 )
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.
Since it behind a feature flag + there are no compilation issues (and we need the new file after the latest changes since last fix) + no fast scrolling/ refresh issues, so 👍 from me.
Note that the BuildKite CI failure (pipeline-pipeline-upload) is expected, as we didn't have BuildKite configured in the release branch yet back then. |
hey @AliSoftware 👋 , was reading your notes above; let me share my reasoning so we can double-check if it makes sense (and adapt to whatever we decide it's the best approach 🙇 ; cc @ashiagr for another opinion as well)
Does the above makes sense? (especially the last point). Another possibility is to manual comment out the not needed code instead of cherry picking from the original fix |
Actually, after taking my late morning coffee, I realized I was wrong with my suggestion above: the code that is added but commented out in this PR's diff should match what's in So nevermind, sorry for the misleading suggestion, and you were correct in your changes made then 👍 As long as the commented code added matches the commented code in develop we should be good 🙂 |
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.
Thanks for a fast turnaround @develric. I tested the PR according to the testing steps and could not reproduce the crash. Comments load fine as well after removing the feature flag.
I agree with your reasoning in #14968 (comment), 👍 from me.
You can test the changes on this Pull Request by downloading the APKs: |
Generated by 🚫 dangerJS |
This cherry pick changes from #14949 as an hotfix for 17.6
NOTE: code that was cherry picked from 17.7 was slightly ahead respect the original code in 17.6. This required adding the
UnifiedCommentListItemDecoration
that was added in 17.7. All this code is behind a feature flag, so as far as it compiles and we confirm the fix works we should be ok.Reporting below the description from the original PR for convenience.
Fixes #14860
Migration to Paging 3 is causing some issues with Post List. We need a bit more for a partial or full migration to Paging 3.
This PR removes the Paging 3 dependency and comments out the code that is using it, since it's behind the feature flag.
To test:
Regression Notes
Potential unintended areas of impact
We are removing the offending library so should be none.
What I did to test those areas of impact (or what existing automated tests I relied on)
What automated tests I added (or what prevented me from doing so)
PR submission checklist:
RELEASE-NOTES.txt
if necessary.