Skip to content

AO3-4500 Sometimes ec.external_author_name can be nil #2376

Merged
merged 1 commit into from May 28, 2016

2 participants

@sarken
Organization for Transformative Works member
sarken commented Feb 27, 2016

I'd really like to see an automated test for this.

@zz9pzza
zz9pzza commented Feb 27, 2016

From a programming point of view the code is just more defensive. It seems "unfair" not to allow the fix in because the original code didn't have a test.

https://github.com/zz9pzza/otwarchive/blob/AO3-4500/app/helpers/application_helper.rb#L163

Has a test for the archivists[pseud].nil? beiing null

( I will say that I have no way to test this apart from hot fixing it on live )

@sarken
Organization for Transformative Works member
sarken commented Feb 27, 2016

That test isn't for quite the same thing. For works imported by an archivist, a proper external creator byline would look like "CREATOR [archived by ARCHIVIST]." The existing test handles the case where ARCHIVIST is nil -- it makes sure the byline just says "CREATOR" instead of the rather odd "CREATOR [archived by]." Here we're dealing with CREATOR being nil and leaving us with a byline that says only "[archived by ARCHIVIST]."

However! Since we talked about this in Slack and clarified that we don't know what causes ec.external_author_name to be nil, we can let the test go for now. We should note on the issue that this is fixing a symptom (the feed giving an error) rather than the root cause (ec.external_author_name being nil, which appears to manifest as a byline that says only "[archived by ARCHIVIST]"). That way, we'll know we need to keep digging until we figure out how to reproduce (and prevent) the nil ec.external_author_name... and that fix will be the one that needs a test. :P

@zz9pzza zz9pzza merged commit 8317c89 into otwcode:master May 28, 2016

1 check passed

Details continuous-integration/travis-ci/pr The Travis CI build passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.