fix(srt): handle undefined/null text in malformed SRT files#1990
Merged
cherkanovart merged 4 commits intomainfrom Feb 17, 2026
Merged
fix(srt): handle undefined/null text in malformed SRT files#1990cherkanovart merged 4 commits intomainfrom
cherkanovart merged 4 commits intomainfrom
Conversation
…and pull operations
Warnings were misleading since entries get filled from sourceData in final merge. Final output is correct, so silent filtering is appropriate.
Resolved conflict: keeping version without warnings (they're misleading)
Contributor
|
No actionable comments were generated in the recent review. 🎉 📝 WalkthroughWalkthroughA patch release for the SRT subsystem that simplifies subtitle entry filtering by removing undefined or null values during push operations. The console warning previously logged for missing text entries has been eliminated, relying solely on truthiness checks for filtering. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
Comment |
AndreyHirsa
approved these changes
Feb 17, 2026
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.
Problem
SRT parser can return entries with
undefinedtext when encountering malformed SRT files (bad timestamps, missing separators). This causesTypeError: Cannot read properties of undefined (reading 'replace')when trying to serialize the SRT back.Example malformed entries:
00:01:44,480 --> 00:0,960(invalid timestamp)00:02:30,400 --00:02:35,240(missing>separator)Solution
Filter undefined/null entries in both
pull()andpush():Why No Warnings?
Initial implementation had warnings, but they were misleading:
Changes
pull()to skip entries with undefined/null textpush()to prevent crashTesting
All tests pass ✅
User Feedback
Tested by users with long SRT files - works correctly, no missing entries in final output.
🤖 Generated with Claude Code
Summary by CodeRabbit
Bug Fixes