Skip to content

AO3-7568 Fix Error 500 when importing a work with a numeric date - #5983

Open
hab-bang wants to merge 1 commit into
otwcode:masterfrom
hab-bang:AO3-7568-error-500-importing-work-with-numeric-date
Open

AO3-7568 Fix Error 500 when importing a work with a numeric date#5983
hab-bang wants to merge 1 commit into
otwcode:masterfrom
hab-bang:AO3-7568-error-500-importing-work-with-numeric-date

Conversation

@hab-bang

Copy link
Copy Markdown
Contributor

Pull Request Checklist

Issue

https://otwarchive.atlassian.net/browse/AO3-7568

Purpose

Fixing the misspelled constant in StoryParser#convert_revised_at that returns an Error 500 when a work's date is a plain number.

The method treats an all-digit date as seconds since the epoch. That branch calls Regex.last_match, but the class is Regexp, so it raises uninitialized constant StoryParser::Regex. The method only rescues ArgumentError and TypeError, so the error escapes the import and the user gets a 500.

Testing Instructions

Follow the reproduction steps on the Jira issue (Post > Import Work with the gist URL from the ticket, and any language):

  • Before this change: Error 500 (NameError: uninitialized constant StoryParser::Regex).
  • After this change: the work imports and you get the work preview.

The date shows as 1970-01-04, because the parser reads an all-numeric date as a Unix timestamp. That is existing behaviour and is not changed here, so it is expected.

Full testing instructions are also on the Jira ticket.

References

Reported from Sentry, issue AO3-STAGING-8Y.

Credit

Name: hayoung
Pronouns: she/her

@hab-bang
hab-bang force-pushed the AO3-7568-error-500-importing-work-with-numeric-date branch from 851f990 to 5c0d73a Compare August 17, 2026 01:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant