Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .nx/version-plans/restore-startup-stall-recovery.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
__default__: patch
---

Harness now restores app startup stall recovery for RN-ready launches, including restart-between-files. Apps are retried when startup stalls without a crash, while confirmed native crashes still fail immediately with crash diagnostics.
21 changes: 2 additions & 19 deletions actions/shared/index.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -4223,10 +4223,8 @@ var ConfigSchema = external_exports.object({
host: external_exports.string().min(1, "Host is required").optional(),
webSocketPort: external_exports.number().optional().default(3001),
bridgeTimeout: external_exports.number().min(1e3, "Bridge timeout must be at least 1 second").default(6e4),
/** @deprecated Removed in favor of crash supervisor. Accepted for backwards compatibility. */
bundleStartTimeout: external_exports.number().optional(),
/** @deprecated Removed in favor of crash supervisor. Accepted for backwards compatibility. */
maxAppRestarts: external_exports.number().optional(),
bundleStartTimeout: external_exports.number().min(1e3, "Bundle start timeout must be at least 1 second").default(15e3),
maxAppRestarts: external_exports.number().min(0, "Max app restarts must be at least 0").default(2),
resetEnvironmentBetweenTestFiles: external_exports.boolean().optional().default(true),
unstable__skipAlreadyIncludedModules: external_exports.boolean().optional().default(false),
unstable__enableMetroCache: external_exports.boolean().optional().default(false),
Expand Down Expand Up @@ -4413,20 +4411,6 @@ var import_node_path5 = __toESM(require("path"), 1);
var import_node_fs5 = __toESM(require("fs"), 1);
var import_node_module2 = require("module");
var import_meta = {};
var DEPRECATED_PROPERTIES = {
bundleStartTimeout: '"bundleStartTimeout" is no longer used and can be removed from your config. Startup crash detection is now handled automatically by the crash supervisor.',
maxAppRestarts: '"maxAppRestarts" is no longer used and can be removed from your config. Startup crash detection is now handled automatically by the crash supervisor.'
};
var warnDeprecatedProperties = (rawConfig) => {
if (typeof rawConfig !== "object" || rawConfig === null) {
return;
}
for (const [key, message] of Object.entries(DEPRECATED_PROPERTIES)) {
if (key in rawConfig) {
console.warn(`[react-native-harness] Deprecation warning: ${message}`);
}
}
};
var extensions = [".js", ".mjs", ".cjs", ".json"];
var importUp = async (dir, name) => {
const filePath = import_node_path5.default.join(dir, name);
Expand All @@ -4445,7 +4429,6 @@ var importUp = async (dir, name) => {
throw new ConfigLoadError(filePathWithExt, error instanceof Error ? error : void 0);
}
try {
warnDeprecatedProperties(rawConfig);
const config = ConfigSchema.parse(rawConfig);
return { config, filePathWithExt, configDir: dir };
} catch (error) {
Expand Down
20 changes: 0 additions & 20 deletions packages/config/src/reader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,25 +9,6 @@ import fs from 'node:fs';
import { createRequire } from 'node:module';
import { ZodError } from 'zod';

const DEPRECATED_PROPERTIES: Record<string, string> = {
bundleStartTimeout:
'"bundleStartTimeout" is no longer used and can be removed from your config. Startup crash detection is now handled automatically by the crash supervisor.',
maxAppRestarts:
'"maxAppRestarts" is no longer used and can be removed from your config. Startup crash detection is now handled automatically by the crash supervisor.',
};

const warnDeprecatedProperties = (rawConfig: unknown) => {
if (typeof rawConfig !== 'object' || rawConfig === null) {
return;
}

for (const [key, message] of Object.entries(DEPRECATED_PROPERTIES)) {
if (key in rawConfig) {
console.warn(`[react-native-harness] Deprecation warning: ${message}`);
}
}
};

const extensions = ['.js', '.mjs', '.cjs', '.json'];

const importUp = async (
Expand Down Expand Up @@ -62,7 +43,6 @@ const importUp = async (
}

try {
warnDeprecatedProperties(rawConfig);
const config = ConfigSchema.parse(rawConfig);
return { config, filePathWithExt, configDir: dir };
} catch (error) {
Expand Down
12 changes: 8 additions & 4 deletions packages/config/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,14 @@ export const ConfigSchema = z
.min(1000, 'Bridge timeout must be at least 1 second')
.default(60000),

/** @deprecated Removed in favor of crash supervisor. Accepted for backwards compatibility. */
bundleStartTimeout: z.number().optional(),
/** @deprecated Removed in favor of crash supervisor. Accepted for backwards compatibility. */
maxAppRestarts: z.number().optional(),
bundleStartTimeout: z
.number()
.min(1000, 'Bundle start timeout must be at least 1 second')
.default(15000),
maxAppRestarts: z
.number()
.min(0, 'Max app restarts must be at least 0')
.default(2),

resetEnvironmentBetweenTestFiles: z.boolean().optional().default(true),
unstable__skipAlreadyIncludedModules: z.boolean().optional().default(false),
Expand Down
Loading
Loading