fix(DiffViewer & ArticleViewer): handle moved articles using MediaWik… #6072
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.
closes #6056
What this PR does
This PR addresses an issue where the
DiffViewer
andArticleViewer
components did not handle moved articles correctly, resulting inerrors
forDiffViewer
andCould not fetch authorship data: Requested page not found. [404]
forArticleViewer
.Fix
Check the current article title by fetching it from the Wikipedia API using the article's page ID. If it matches, do not update the Redux store; otherwise, update the title and URL for the respective article.
NOTE: The article title will only be cross-checked for articles when the user wants to view the "Current Version w/ Authorship Highlighting" or "Show Cumulative Changes."
Screenshots
Before:
Before.mp4
After:
After.mp4