Skip to content

Conversation

@graycreate
Copy link
Member

Summary

This PR addresses two critical issues:

  1. App crash when filter menu content is empty - Fixes index out of range error reported in TestFlight feedback
  2. Fastlane changelog helper UI import error - Resolves build pipeline failure

Changes

1. Filter Menu Crash Fix (FeedInfo.swift)

File: V2er/State/DataFlow/Model/FeedInfo.swift:28

Problem:

  • App crashes with "Index out of range" when accessing empty filter results
  • Crash reported on iPhone17,1 running iOS 26.0.1
  • Error occurred in FeedInfo.isValid() method

Root Cause:

// Before (incorrect)
return items.count > 0 || items[0].userName.notEmpty

The logic used || (OR) which attempts to access items[0] even when array is empty.

Solution:

// After (correct)
return items.count > 0 && items[0].userName.notEmpty

Changed to && (AND) to ensure items[0] is only accessed when array has elements.

Impact: Prevents crash when navigating to filter categories with no content.

2. Fastlane UI Import Fix (changelog_helper.rb)

File: fastlane/changelog_helper.rb:8

Problem:

  • GitHub Actions workflow failing with NameError: uninitialized constant ChangelogHelper::UI
  • Blocked release pipeline from extracting changelog entries

Root Cause:

# Before (incorrect)
UI = FastlaneCore::UI unless Fastlane.const_defined?(:UI)

Referenced undefined Fastlane module causing NameError.

Solution:

# After (correct)
UI = FastlaneCore::UI unless defined?(UI)

Use Ruby's defined?() to properly check constant existence.

Impact: Enables automatic changelog extraction for TestFlight release notes.

Test Plan

  • Verify app doesn't crash when accessing empty filter categories
  • Test navigation through all filter menu options
  • Confirm Fastlane beta lane runs successfully
  • Verify changelog extraction works in CI pipeline
  • Run existing test suite to ensure no regressions

Related Issues

  • TestFlight crash feedback (Incident ID: 01ADA8EF-641A-4F3B-B19D-F03FD826C7B3)
  • GitHub Actions workflow failures (runs #18409401797, #18409321673, #18408812234)

🤖 Generated with Claude Code

graycreate and others added 2 commits October 11, 2025 09:52
- Changed from Fastlane.const_defined?(:UI) to defined?(UI)
- Fixes NameError: uninitialized constant ChangelogHelper::UI

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Changed OR (||) to AND (&&) in FeedInfo.isValid()
- Prevents index out of range crash when items array is empty
- Fixes crash reported in TestFlight feedback

Crash details:
- Swift runtime failure: Index out of range
- Location: FeedInfo.isValid() accessing items[0] on empty array
- Trigger: Filter menu with no corresponding content

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings October 11, 2025 01:53
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes two critical production issues: an app crash when accessing empty filter menus and a build pipeline failure in the Fastlane changelog helper.

  • Fixed logical error causing index out of range crash in filter menu validation
  • Corrected Ruby constant definition check in Fastlane build script

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
V2er/State/DataFlow/Model/FeedInfo.swift Fixed logical operator in isValid() method to prevent array access when empty
fastlane/changelog_helper.rb Corrected constant existence check to fix build pipeline

@github-actions
Copy link

Code Coverage Report ❌

Current coverage: 0%

@graycreate graycreate merged commit abca50f into main Oct 11, 2025
6 checks passed
@graycreate graycreate deleted the bugfix/fix-filter-menu-crash branch October 11, 2025 02:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants