Skip to content

fix(ios): return NO from PdfManager requiresMainQueueSetup (#1021) - #1027

Open
hmadhsan wants to merge 1 commit into
wonday:masterfrom
hmadhsan:fix/pdf-manager-requires-main-queue-setup
Open

fix(ios): return NO from PdfManager requiresMainQueueSetup (#1021)#1027
hmadhsan wants to merge 1 commit into
wonday:masterfrom
hmadhsan:fix/pdf-manager-requires-main-queue-setup

Conversation

@hmadhsan

Copy link
Copy Markdown

Closes #1021

🐛 What was the issue?

PdfManager in ios/RNPDFPdf/PdfManager.mm returned YES from +requiresMainQueueSetup, despite having an empty init method that performs no UIKit or main-thread initialization work.
Returning YES unnecessarily forces React Native bridge setup for PdfManager onto the main thread via dispatch_sync, which can cause performance bottlenecks and rare app hang issues on iOS during app startup.

🛠️ What did we fix?

  • Changed +requiresMainQueueSetup in ios/RNPDFPdf/PdfManager.mm to return NO.
  • Kept view manager setup (RNPDFPdfViewManager.mm, RNPDFPdfPageViewManager.mm) unchanged as view managers construct UI components on the main thread.

🧪 Testing & Verification

  • Verified that PdfManager does not execute any UIKit or UI calls in init or module setup.
  • Verified that returning NO allows React Native to initialize PdfManager off the main queue safely without blocking bridge setup.

Signed-off-by: hmadhsan <20043390+hmadhsan@users.noreply.github.com>
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.

New Architecture: Return NO from requiresMainQueueSetup

1 participant