-
Notifications
You must be signed in to change notification settings - Fork 25
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
Fix Manual Syncing Tool - #127
Merged
Merged
Conversation
This file contains 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.
Description
Sometimes, the manual syncing tool would only sync some comments and not others, and the only indication that there was something wrong would be a 500 error. After some digging, it was determined that this was happening when the syncing tool would attempt to sync a child comment before that child's parent comment was synced.
To fix this, we switched the order that we fetch comments from the Disqus API, and we sync parent comments before child comments in order to do our best effort to sync child comments in the right order. To account for child comments with parents outside of the date range that haven't been synced yet, we removed the check for parent comments to allow those child comments to still sync. Later on, if those parent comments get synced, we made a change so that these child comments will update with the parent comment data.
A second issue that was discovered in testing was that comments posted via RSS would have trouble syncing due to missing an identifier in the thread data. This was remedied by removing the error when missing the thread data, which would still allow for syncing of these comments minus a direct link to the comment in the WordPress UI that would otherwise be there in non-RSS comment.
Additionally, these changes include improvements to the logging that we expose in the browser console to make future troubleshooting easier.
And last but not least, per the request of some users, we increased the date range for manual syncing to 5 years to make the tool easier to use for bulk comment syncing.
Motivation and Context
This bug was reported by a few publishers to the Disqus support team and would consistently break the syncing tool.
How Has This Been Tested?
This has been tested on the Disqus WP test site hooked up to the Disqus Blog. Aside from testing the actual syncing, we benchmarked the syncing with staggered parallelism vs without staggered parallelism, and we decided to remove staggered parallelism since the results were about twice as fast with syncing.
Tests for increasing the date range: Was curious as to how the tool would perform without limiting to 1 year, so did additional tests with larger sizes (only without staggered parallelism so it wouldn't take too long):
Parameters: 3 years (1/1/21 - 12/12/23). 4123 comments
Without staggered parallelism: 15min 45 seconds. All comments synced.
Parameters: 5 years (12/12/18 - 12/12/23). 12730 comments
Without staggered parallelism: 49 minutes. All comments synced.
Screenshots (if appropriate):
Types of changes
Checklist: