Add content logging to help debug a Story post crash - #14191
Merged
Conversation
|
You can trigger optional UI/connected tests for these changes by visiting CircleCI here. |
3 tasks
|
You can test the changes on this Pull Request by downloading the APK here. |
mzorz
approved these changes
Mar 4, 2021
mzorz
left a comment
Contributor
There was a problem hiding this comment.
Thank you for these changes @renanferrari 💯
I was able to test the try/catch path by adding an artificial throw StringIndexOutOfBoundsException("TEST") line within the try{} block, and confirmed the logcat showed what I expected:
2021-03-04 18:17:21.062 15273-15273/org.wordpress.android E/WordPress-EDITOR: Error while parsing Story blocks: TEST
2021-03-04 18:17:24.027 15273-15333/org.wordpress.android D/Volley: [534] BasicNetwork.logSlowRequests: HTTP response for request=<[ ] https://public-api.wordpress.com/wpcom/v2/sites/176139122/rewind/capabilities/?_locale=en_US 0x7b2dc254 NORMAL 39> [lifetime=20476], [size=19], [rc=200], [retryCount=0]
2021-03-04 18:17:29.517 15273-15273/org.wordpress.android E/WordPress-EDITOR: HTML content of the post before the crash: <!-- wp:jetpack/story {"mediaFiles":[{"alt":"asdfafdafa","caption":"","id":"1","link":"","mime":"image/jpeg","type":"image","url":""}]} -->
<div class="wp-story wp-block-jetpack-story"></div>
<!-- /wp:jetpack/story -->
Also confirmed the test case runs correctly
Finally, I gave a pass on the code which looks right and to the point 👍
LGTM ![]()
This was referenced Apr 14, 2021
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.
This PR is a follow up to #14185 and helps to investigate #13697.
It basically adds a
SiteModelparameter to thefindAllStoryBlocksInPostAndPerformOnEachMediaFilesJsonmethod which we then use to check if we should also log the Post's content in addition to reporting any caughtStringIndexOutOfBoundsException. The logic used to determine that is based on this one, which makes sure we only log posts that are not private or password-protected, on WPCom sites that are also not private.To test:
Again, there's not much to test here since we can't reproduce the issue, but you can smoke test the Story feature and make sure nothing looks off.
PR submission checklist:
RELEASE-NOTES.txtif necessary.