fix: GroupByRepoでcreated_atがundefinedの場合にsplitでクラッシュする問題を修正#1306
Merged
Conversation
created_atが欠損したイベントデータが渡されるとiso8601DateTimeExtractで TypeError: Cannot read properties of undefined (reading 'split')が発生するため Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or 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.
概要
kusaページのGroup By Repo表示で、
created_atが欠損したイベントデータが渡された場合にTypeError: Cannot read properties of undefined (reading 'split')でクラッシュする問題を修正Why
GitHub Events APIから取得したイベントデータの
created_atがundefinedのケースが存在し、iso8601DateTimeExtract関数で.split('T')を呼び出す際にTypeErrorが発生していた前回のPR(#1303)で
commitsがundefinedのケースは修正されたが、同様のパターンでcreated_atがundefinedのケースが残っていたHow
iso8601DateTimeExtractの引数型をstring | undefinedに変更し、undefined/空文字の場合は空文字を返すガードを追加contributions-by-repo.tsxでrow.created_atに?? ''のフォールバックを追加確認観点
iso8601DateTimeExtractにundefinedを渡した場合のテストが通ることiso8601DateTimeExtractに空文字を渡した場合のテストが通ることcreated_atがundefinedのPushEventでContributionsByRepoがクラッシュしないテストが通ることjestで17テスト全パス)