Skip to content

Hot Update SourceMap Version Matching


When a React Native application hot-updates the JavaScript Bundle via OTA solutions such as CodePush, the APK or IPA application version does not change. To ensure each hot-update bundle matches the correct SourceMap, you need to set a different RUM version for the base package and each hot-update bundle, and upload the corresponding SourceMap using the same version.

Version Length Limit

The length of version must not exceed 20. It is recommended to use short version strings like 1.2-cp-1, and avoid using overly long hot-update descriptions.

Version Example

Assume the application version is 1.2:

JavaScript Bundle RUM version version Used for SourceMap Upload
Base package 1.2 1.2
First hot-update bundle 1.2-cp-1 1.2-cp-1
Second hot-update bundle 1.2-cp-2 1.2-cp-2

Configuring version

When initializing the SDK, modify the version field via dataModifier:

const rumVersion = '1.2-cp-1';

let config: FTMobileConfig = {
  datawayUrl: datawayUrl,
  clientToken: clientToken,
  env: 'prod',
  dataModifier: {
    version: rumVersion,
  },
};

await FTMobileReactNative.sdkConfig(config);

Each bundle sets its own rumVersion. This configuration only modifies the version in the reported data; it does not change the Android versionName, iOS MARKETING_VERSION, or the target version of CodePush.

Native Symbol Files

A complete React Native sourcemap.zip must contain both the JavaScript SourceMap of the current bundle and the native symbol files of the corresponding base package. Native crashes still need to be resolved using Android mapping.txt, symbol .so files, or iOS dSYM.

Pure JavaScript hot-updates do not change native symbol files, so you can reuse the native symbol files of the base package. However, each hot-update version must bundle them together with the current JavaScript SourceMap and upload them using the version of that hot-update version. For the specific directory structure, refer to React Native Symbol File Upload.

Uploading SourceMap

Every time you release a base package or a hot-update bundle:

  1. Build the JavaScript Bundle and generate the corresponding SourceMap at the same time;
  2. Package it as a sourcemap.zip according to the requirements in React Native Symbol File Upload;
  3. When uploading, fill in the same app_id, env, and version as the RUM data.

For example, if update-one reports a version of 1.2-cp-1, when uploading its SourceMap, the version must also be 1.2-cp-1.

For upload methods, refer to Script Upload SourceMap or Upload via Frontend Page. Do not delete old SourceMap versions that are still in use by users.

Feedback

Is this page helpful?