Skip to content

[NOJIRA] [FIX] [V2] Session Replay build issues#1276

Open
cdn34dd wants to merge 4 commits intofeature/v2from
carlosnogueira/fix/fix-session-replay-podspec
Open

[NOJIRA] [FIX] [V2] Session Replay build issues#1276
cdn34dd wants to merge 4 commits intofeature/v2from
carlosnogueira/fix/fix-session-replay-podspec

Conversation

@cdn34dd
Copy link
Copy Markdown
Contributor

@cdn34dd cdn34dd commented Apr 27, 2026

What does this PR do?

This PR does two things:

  • Refactors the session-replay podspec file to properly align with newer versions of React Native, removing Folly flags and restructuring install_modules_dependencies. This solves build issues and potential hangups during the process.
  • Closes the chokidar watcher after bundle_build_done so the Node process is able to exit, avoiding potential hangups that will hold up the build process.

Additional Notes

Tested on an specific Expo 54.0.33 RN 0.81.5 test app.

Review checklist (to be filled by reviewers)

  • Feature or bugfix MUST have appropriate tests
  • Make sure you discussed the feature or bugfix with the maintaining team in an Issue
  • Make sure each commit and the PR mention the Issue number (cf the CONTRIBUTING doc)
  • If this PR is auto-generated, please make sure also to manually update the code related to the change

Copilot AI review requested due to automatic review settings April 27, 2026 18:08
@cdn34dd cdn34dd requested a review from a team as a code owner April 27, 2026 18:08
Copy link
Copy Markdown

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

Addresses build stability issues for the Session Replay package by updating iOS CocoaPods configuration for newer React Native versions and preventing Metro/Node processes from hanging after bundling completes.

Changes:

  • Refactors the Session Replay podspec to remove Folly-specific flags and restructure install_modules_dependencies / xcconfig handling for newer RN.
  • Updates the Metro asset bundler to manage a single chokidar watcher instance and close it after bundling-related reporter events to allow Node to exit.

Reviewed changes

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

File Description
packages/react-native-session-replay/src/metro/index.ts Replaces boolean “watching” guard with a chokidar watcher instance and adds logic to close it after Metro reporter events.
packages/react-native-session-replay/DatadogSDKReactNativeSessionReplay.podspec Simplifies new-arch compiler flags and reorganizes pod_target_xcconfig + install_modules_dependencies handling.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 76 to +77
mergeSvgAssets(assetsDir);

Copy link

Copilot AI Apr 27, 2026

Choose a reason for hiding this comment

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

The watcher is closed not only on bundle_build_done but also on transformer_load_done. transformer_load_done can fire early (before assets are added / before bundling finishes), which can stop the chokidar watcher prematurely and cause newly added SVGs to never be merged. Consider only closing the watcher on bundle_build_done (or otherwise gating the close to one-off bundle/CI builds).

Suggested change
mergeSvgAssets(assetsDir);
mergeSvgAssets(assetsDir);
}
if (event.type === 'bundle_build_done') {

Copilot uses AI. Check for mistakes.
Comment on lines +78 to +84
// Close the file watcher after bundling completes
// This prevents the chokidar watcher from keeping the
// Node process alive during release/CI builds
if (watcher) {
watcher.close();
watcher = null;
}
Copy link

Copilot AI Apr 27, 2026

Choose a reason for hiding this comment

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

There’s no automated coverage around the new lifecycle behavior (closing the chokidar watcher after a Metro reporter event). Since this affects build stability and can differ between dev server vs one-off bundling, adding a unit test that mocks chokidar and asserts when close() is (and is not) called would help prevent regressions.

Copilot uses AI. Check for mistakes.
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.

3 participants