Skip to content

iOS: extract CodePushErrorUtils into its own header - #56

Open
ofalvai wants to merge 1 commit into
ios-sha256-refactorfrom
ios-errorutil-refactor
Open

iOS: extract CodePushErrorUtils into its own header#56
ofalvai wants to merge 1 commit into
ios-sha256-refactorfrom
ios-errorutil-refactor

Conversation

@ofalvai

@ofalvai ofalvai commented Sep 9, 2026

Copy link
Copy Markdown
Collaborator

Why

CodePushErrorUtils.m imports CodePush.h, which imports React/RCTEventEmitter.h. At the same time, all logging must be done through this error util because failed update tracking is based on catching CodePush errors explicitly

Therefore, it's impossible to do proper logging in new code without implicitly depending on React itself (which complicates unit testing).

@ofalvai
ofalvai added this pull request to stack #41 September 9, 2026 06:28
@ofalvai
ofalvai removed this pull request from stack #41 September 9, 2026 06:38
@ofalvai
ofalvai changed the base branch from android-package-install-tests to ios-sha256-refactor September 9, 2026 06:38
@ofalvai
ofalvai added this pull request to stack #57 September 9, 2026 06:42
@ofalvai ofalvai changed the title ios errorutil refactor iOS: extract CodePushErrorUtils into its own header Sep 9, 2026
@ofalvai
ofalvai requested a balanced review from Copilot September 9, 2026 06:54

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

The new public dependency is not exported by CocoaPods or either Xcode target.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Extracts CodePushErrorUtils into a Foundation-only header to remove its React dependency.

Changes:

  • Adds the standalone error utility header.
  • Updates imports and Xcode project references.
File summaries
File Description
ios/CodePush/CodePushErrorUtils.m Imports the extracted header.
ios/CodePush/CodePushErrorUtils.h Declares the error utility API.
ios/CodePush/CodePush.h Re-exports the extracted header.
ios/CodePush.xcodeproj/project.pbxproj References the new header.
Review details
  • Files reviewed: 4/4 changed files
  • Comments generated: 2
  • Review effort level: Balanced

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

13BE3DED1AC21097009241FE /* CodePush.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CodePush.m; path = CodePush/CodePush.m; sourceTree = "<group>"; };
1B23B9131BF9267B000BB2F0 /* RCTConvert+CodePushInstallMode.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = "RCTConvert+CodePushInstallMode.m"; path = "CodePush/RCTConvert+CodePushInstallMode.m"; sourceTree = "<group>"; };
1B762E8F1C9A5E9A006EF800 /* CodePushErrorUtils.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CodePushErrorUtils.m; path = CodePush/CodePushErrorUtils.m; sourceTree = "<group>"; };
8C69F7C2081D7CEE96691674 /* CodePushErrorUtils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CodePushErrorUtils.h; path = CodePush/CodePushErrorUtils.h; sourceTree = "<group>"; };

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Resolved, see #56 (comment)

Comment thread ios/CodePush/CodePush.h Outdated
#endif

#import <Foundation/Foundation.h>
#import "CodePushErrorUtils.h"

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Fixed: https://github.com/bitrise-io/react-native-code-push/compare/b19db781f968144d82b4e9e6c1d0b4bd248359b0..bd90f89353bb2b38d41cc6c5941d1ebaa665259e

I realized CodePushErrorUtils.h more like a "package-private" header and doesn't need to be a public API at all, so it's now imported into the actual users explicitly.

@ofalvai
ofalvai force-pushed the ios-errorutil-refactor branch from b19db78 to bd90f89 Compare September 9, 2026 07:15
@ofalvai
ofalvai marked this pull request as ready for review September 9, 2026 07:29
@ofalvai
ofalvai force-pushed the ios-errorutil-refactor branch from bd90f89 to 4b2056b Compare September 9, 2026 11:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants