Skip to content

Conversation

@gladiuscode
Copy link
Owner

@gladiuscode gladiuscode commented Oct 20, 2025

This PR fixes #91

Summary by CodeRabbit

  • Refactor
    • Internal code organization improvements for better maintainability. No changes to user-facing functionality.

@gladiuscode gladiuscode self-assigned this Oct 20, 2025
@gladiuscode gladiuscode added the bug Something isn't working label Oct 20, 2025
@coderabbitai
Copy link

coderabbitai bot commented Oct 20, 2025

Walkthrough

The change refactors SDK version checking logic in the Swift AppDelegate updater by extracting the inline methodPrefix decision into a new computeMethodPrefix helper function. The helper determines whether to include the 'override' keyword based on SDK version: returns 'override' for versions < 53, and empty string for versions >= 53 or invalid/missing versions.

Changes

Cohort / File(s) Summary
Method prefix logic centralization
plugin/src/withRNOrientationAppDelegate.ts
Extracted inline SDK version comparison logic into a dedicated computeMethodPrefix(sdkVersion) helper function. The helper returns 'override' for SDK versions < 53 and empty string for versions >= 53 or invalid inputs, replacing the previous inline check and improving code clarity.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~5 minutes

Possibly related PRs

Suggested labels

iOS

Poem

🐰 A helper hops to center stage,
Where version checks were once unwound,
No more inline logic to engage—
The override keyword finds solid ground!
Neat and tidy, refactored with grace,
SDK logic in its rightful place! ✨

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The PR title "fix: expo plugin breaking due to override keyword not supported in version 54" directly describes the main objective of the pull request, which is to fix the conditional use of the override keyword based on SDK version. According to the raw summary, the changes replace inline methodPrefix logic with a helper function that returns 'override' for SDK versions < 53 and '' for versions >= 53, which aligns precisely with the title's focus on addressing the version 54 compilation failure caused by the override keyword.
Linked Issues Check ✅ Passed The code changes meet the requirements specified in linked issue #91. The issue expects the override keyword to be used in SDK 52 and omitted in SDK versions greater than 53. The new computeMethodPrefix helper function implements exactly this logic by returning 'override' for versions < 53 and an empty string for versions >= 53, which directly addresses the reported bug where compilation fails in version 54 due to the unsupported override keyword.
Out of Scope Changes Check ✅ Passed All changes in this pull request are directly scoped to fixing the reported bug in issue #91. The modifications are contained within plugin/src/withRNOrientationAppDelegate.ts and involve extracting the methodPrefix logic into a helper function to properly handle SDK version differences. No unrelated changes, refactoring outside the scope of the bug fix, or modifications to unrelated areas of the codebase are present.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch 91-bug-expo-plugin-breaking-due-to-override-keyword-not-supported-in-version-54

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a50866c and ef71a36.

📒 Files selected for processing (1)
  • plugin/src/withRNOrientationAppDelegate.ts (2 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (5)
  • GitHub Check: build-ios
  • GitHub Check: lint
  • GitHub Check: build-android
  • GitHub Check: test
  • GitHub Check: build-library
🔇 Additional comments (2)
plugin/src/withRNOrientationAppDelegate.ts (2)

62-62: LGTM! Clean refactoring.

Extracting the methodPrefix logic into a dedicated helper improves readability and correctly fixes the SDK 54 bug.


81-97: Excellent fix with robust error handling!

The numeric comparison correctly solves the SDK 54 issue. The old string-based logic !sdkVersion?.includes('53') incorrectly returned 'override' for SDK 54, while this implementation properly returns an empty string for all versions >= 53.

Edge cases are well handled:

  • Missing/undefined version → safe fallback to ''
  • Non-numeric version strings → NaN check → safe fallback to ''
  • Decimal versions (e.g., "53.1") → numeric comparison works correctly

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@gladiuscode gladiuscode merged commit 1142126 into main Oct 20, 2025
6 checks passed
@gladiuscode gladiuscode deleted the 91-bug-expo-plugin-breaking-due-to-override-keyword-not-supported-in-version-54 branch October 24, 2025 21:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Expo plugin breaking due to override keyword not supported in version 54

2 participants