-
-
Notifications
You must be signed in to change notification settings - Fork 26
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
Only update the page title for non-error versions #1061
Merged
Mr0grog
merged 5 commits into
main
from
751-if-every-error-page-has-the-same-title-its-hard-to-know-which-page-you-are-talking-about
Jan 19, 2023
Merged
Only update the page title for non-error versions #1061
Mr0grog
merged 5 commits into
main
from
751-if-every-error-page-has-the-same-title-its-hard-to-know-which-page-you-are-talking-about
Jan 19, 2023
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
37 tasks
Taking a slight pause here; I discovered that we wound up with some placeholder titles (e.g. "None", ""No title available") from Versionista in the distant past. Going to see about a data migration to remove those. |
If a new version is an error (e.g. a 404 status code because the page was removed), don't update the page record's title with the title from the error response. Fixes #751.
We have a lot of PDFs with no title, so fall back to the last path component of the URL (i.e. the filename) for a title if nothing else can be found.
Mr0grog
force-pushed
the
751-if-every-error-page-has-the-same-title-its-hard-to-know-which-page-you-are-talking-about
branch
from
January 19, 2023 18:23
f1692b4
to
6ec8131
Compare
Mr0grog
deleted the
751-if-every-error-page-has-the-same-title-its-hard-to-know-which-page-you-are-talking-about
branch
January 19, 2023 18:38
Mr0grog
added a commit
that referenced
this pull request
Jan 19, 2023
I messed up a bunch of page titles in #1061 because I overlooked the fact that `Version#sync_page_title` only functioned if called on the latest version. This fixes the issue by moving all the meaningful logic about where and when to grab a title to `Page#update_page_title` and changes `Version#sync_page_title` to just call that, but with an argument that tells it to only look forward from the version's capture time. That's not *exactly* the same behavior for the Version method, but gets us effectively the same result. This should also make the migration run faster.
Mr0grog
added a commit
that referenced
this pull request
Jan 19, 2023
I messed up a bunch of page titles in #1061 because I overlooked the fact that `Version#sync_page_title` only functioned if called on the latest version. This fixes the issue by moving all the meaningful logic about where and when to grab a title to `Page#update_page_title` and changes `Version#sync_page_title` to just call that, but with an argument that tells it to only look forward from the version's capture time. That's not *exactly* the same behavior for the Version method, but gets us effectively the same result. This should also make the migration run faster.
Mr0grog
added a commit
to edgi-govdata-archiving/web-monitoring-ops
that referenced
this pull request
Jan 19, 2023
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.
If a new version is an error (e.g. a 404 status code because the page was removed), don't update the page record's title with the title from the error response. This also uses the filename component of the URL as a fallback title in case no versions with a parsed title can be found.
Fixes #751.
Fixes #468.
To-Do: