@scalebun/react-native 1.0.4 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/android/src/main/java/com/scalebun/rn/ota/SlotManager.kt +70 -4
- package/dist/scalebun.full.js +33132 -0
- package/dist/scalebun.full.js.map +1 -0
- package/dist/scalebun.slim.js +29930 -0
- package/dist/scalebun.slim.js.map +1 -0
- package/lib/commonjs/bootstrap/FeatureRegistry.js +4 -4
- package/lib/commonjs/bootstrap/FeatureRegistry.js.map +1 -1
- package/lib/commonjs/bootstrap/SDKBootstrapper.js +20 -17
- package/lib/commonjs/bootstrap/SDKBootstrapper.js.map +1 -1
- package/lib/commonjs/compat/codepush.js +78 -15
- package/lib/commonjs/compat/codepush.js.map +1 -1
- package/lib/commonjs/core/config/schema.js +412 -219
- package/lib/commonjs/core/config/schema.js.map +1 -1
- package/lib/commonjs/core/constants/endpoints.js +9 -6
- package/lib/commonjs/core/constants/endpoints.js.map +1 -1
- package/lib/commonjs/core/constants/protocol.js +31 -0
- package/lib/commonjs/core/constants/protocol.js.map +1 -0
- package/lib/commonjs/core/constants/timings.js +4 -1
- package/lib/commonjs/core/constants/timings.js.map +1 -1
- package/lib/commonjs/core/lifecycle/appLifecycle.js +1 -1
- package/lib/commonjs/core/lifecycle/appLifecycle.js.map +1 -1
- package/lib/commonjs/debug/bootstrap.js +30 -10
- package/lib/commonjs/debug/bootstrap.js.map +1 -1
- package/lib/commonjs/debug/exportBridge.js +5 -3
- package/lib/commonjs/debug/exportBridge.js.map +1 -1
- package/lib/commonjs/debug/hostResolver.js +2 -2
- package/lib/commonjs/debug/hostResolver.js.map +1 -1
- package/lib/commonjs/debug/perfWiring.js +4 -4
- package/lib/commonjs/debug/perfWiring.js.map +1 -1
- package/lib/commonjs/debug/replayWiring.js +5 -5
- package/lib/commonjs/debug/replayWiring.js.map +1 -1
- package/lib/commonjs/debug/screenTracking.js +2 -2
- package/lib/commonjs/debug/screenTracking.js.map +1 -1
- package/lib/commonjs/debug/sessionWiring.js +2 -2
- package/lib/commonjs/debug/sessionWiring.js.map +1 -1
- package/lib/commonjs/features/crash/NativeCrashFeature.js +1 -1
- package/lib/commonjs/features/crash/NativeCrashFeature.js.map +1 -1
- package/lib/commonjs/features/crash/globalHandler.js +3 -3
- package/lib/commonjs/features/crash/globalHandler.js.map +1 -1
- package/lib/commonjs/features/crash/nativeCrashBridge.js +7 -7
- package/lib/commonjs/features/crash/nativeCrashBridge.js.map +1 -1
- package/lib/commonjs/features/crash/rejectionHandler.js +2 -2
- package/lib/commonjs/features/crash/rejectionHandler.js.map +1 -1
- package/lib/commonjs/features/engage/EngageArchetypeRenderers.js +0 -9
- package/lib/commonjs/features/engage/EngageArchetypeRenderers.js.map +1 -1
- package/lib/commonjs/features/engage/EngageInAppView.js +1 -1
- package/lib/commonjs/features/engage/EngageInAppView.js.map +1 -1
- package/lib/commonjs/features/engage/EngagePromptProvider.js +17 -17
- package/lib/commonjs/features/engage/EngagePromptProvider.js.map +1 -1
- package/lib/commonjs/features/engage/EngageTransport.js +5 -5
- package/lib/commonjs/features/engage/EngageTransport.js.map +1 -1
- package/lib/commonjs/features/engage/engagePushTokenBridge.js +4 -4
- package/lib/commonjs/features/engage/engagePushTokenBridge.js.map +1 -1
- package/lib/commonjs/features/engage/engageShakeBridge.js +2 -2
- package/lib/commonjs/features/engage/engageShakeBridge.js.map +1 -1
- package/lib/commonjs/features/engage/engageSignals.js +1 -1
- package/lib/commonjs/features/engage/engageSignals.js.map +1 -1
- package/lib/commonjs/features/engage/engageStoreReviewBridge.js +2 -2
- package/lib/commonjs/features/engage/engageStoreReviewBridge.js.map +1 -1
- package/lib/commonjs/features/engage/engageTestSeenStore.js +1 -1
- package/lib/commonjs/features/engage/engageTestSeenStore.js.map +1 -1
- package/lib/commonjs/features/engage/engageThrottle.js +4 -4
- package/lib/commonjs/features/engage/engageThrottle.js.map +1 -1
- package/lib/commonjs/features/engage/engageTriggerEngine.js +4 -4
- package/lib/commonjs/features/engage/engageTriggerEngine.js.map +1 -1
- package/lib/commonjs/features/engage/engageWindowInsets.js +1 -1
- package/lib/commonjs/features/engage/engageWindowInsets.js.map +1 -1
- package/lib/commonjs/features/install-referrer/installReferrer.js +3 -3
- package/lib/commonjs/features/install-referrer/installReferrer.js.map +1 -1
- package/lib/commonjs/features/journey/calibrationContext.js +0 -9
- package/lib/commonjs/features/journey/calibrationContext.js.map +1 -1
- package/lib/commonjs/features/journey/journeyManager.js +4 -1
- package/lib/commonjs/features/journey/journeyManager.js.map +1 -1
- package/lib/commonjs/features/navigation/AutoScreenDetector.js +4 -4
- package/lib/commonjs/features/navigation/AutoScreenDetector.js.map +1 -1
- package/lib/commonjs/features/ota/OtaOrchestrator.js +27 -18
- package/lib/commonjs/features/ota/OtaOrchestrator.js.map +1 -1
- package/lib/commonjs/features/ota/geoCountry.js +2 -2
- package/lib/commonjs/features/ota/geoCountry.js.map +1 -1
- package/lib/commonjs/features/ota/retry.js +2 -2
- package/lib/commonjs/features/ota/retry.js.map +1 -1
- package/lib/commonjs/features/replay/core/logger/logger.js +0 -4
- package/lib/commonjs/features/replay/core/logger/logger.js.map +1 -1
- package/lib/commonjs/features/replay/integrations/network/networkAdapter.js +1 -54
- package/lib/commonjs/features/replay/integrations/network/networkAdapter.js.map +1 -1
- package/lib/commonjs/features/replay/integrations/react-navigation/navigationIntegration.js +1 -1
- package/lib/commonjs/features/replay/integrations/react-navigation/navigationIntegration.js.map +1 -1
- package/lib/commonjs/features/replay/integrations/touch/ReplayRoot.js +1 -1
- package/lib/commonjs/features/replay/integrations/touch/ReplayRoot.js.map +1 -1
- package/lib/commonjs/features/replay/pipeline/batching/batchManager.js +1 -1
- package/lib/commonjs/features/replay/pipeline/batching/batchManager.js.map +1 -1
- package/lib/commonjs/features/replay/pipeline/retry/retryPolicy.js +1 -1
- package/lib/commonjs/features/replay/pipeline/retry/retryPolicy.js.map +1 -1
- package/lib/commonjs/features/replay/public/api.js +7 -7
- package/lib/commonjs/features/replay/public/api.js.map +1 -1
- package/lib/commonjs/features/replay/replay/session/sessionOrchestrator.js +9 -9
- package/lib/commonjs/features/replay/replay/session/sessionOrchestrator.js.map +1 -1
- package/lib/commonjs/features/session/BackendSessionAdapter.js +41 -41
- package/lib/commonjs/features/session/BackendSessionAdapter.js.map +1 -1
- package/lib/commonjs/features/session/DesktopSessionTransport.js +5 -2
- package/lib/commonjs/features/session/DesktopSessionTransport.js.map +1 -1
- package/lib/commonjs/features/session/JourneyEventPipeline.js +1 -1
- package/lib/commonjs/features/session/JourneyEventPipeline.js.map +1 -1
- package/lib/commonjs/features/session/ReplayCaptureManager.js +14 -14
- package/lib/commonjs/features/session/ReplayCaptureManager.js.map +1 -1
- package/lib/commonjs/features/session/SessionManager.js +9 -9
- package/lib/commonjs/features/session/SessionManager.js.map +1 -1
- package/lib/commonjs/features/session/SyncDecisionEngine.js +1 -1
- package/lib/commonjs/features/session/SyncDecisionEngine.js.map +1 -1
- package/lib/commonjs/features/skan/skanBridge.js +6 -15
- package/lib/commonjs/features/skan/skanBridge.js.map +1 -1
- package/lib/commonjs/features/skan/skanConversionManager.js +5 -5
- package/lib/commonjs/features/skan/skanConversionManager.js.map +1 -1
- package/lib/commonjs/integrations/fetch/fetchInterceptor.js +1 -1
- package/lib/commonjs/integrations/fetch/fetchInterceptor.js.map +1 -1
- package/lib/commonjs/integrations/xhr/xhrInterceptor.js +1 -1
- package/lib/commonjs/integrations/xhr/xhrInterceptor.js.map +1 -1
- package/lib/commonjs/metro/composeSourceMap.js +105 -0
- package/lib/commonjs/metro/composeSourceMap.js.map +1 -0
- package/lib/commonjs/metro/featureModules.js +131 -0
- package/lib/commonjs/metro/featureModules.js.map +1 -0
- package/lib/commonjs/metro/index.js +123 -2
- package/lib/commonjs/metro/index.js.map +1 -1
- package/lib/commonjs/metro/serializerCompose.js +129 -0
- package/lib/commonjs/metro/serializerCompose.js.map +1 -0
- package/lib/commonjs/pipeline/dispatcher/dispatcher.js +1 -1
- package/lib/commonjs/pipeline/dispatcher/dispatcher.js.map +1 -1
- package/lib/commonjs/pipeline/queue/flushQueue.js +2 -2
- package/lib/commonjs/pipeline/queue/flushQueue.js.map +1 -1
- package/lib/commonjs/pipeline/queue/persistentQueue.js +6 -37
- package/lib/commonjs/pipeline/queue/persistentQueue.js.map +1 -1
- package/lib/commonjs/pipeline/scheduler/flushScheduler.js +1 -1
- package/lib/commonjs/pipeline/scheduler/flushScheduler.js.map +1 -1
- package/lib/commonjs/public/ScaleBunFacade.js +64 -15
- package/lib/commonjs/public/ScaleBunFacade.js.map +1 -1
- package/lib/commonjs/push/PushManager.js +3 -3
- package/lib/commonjs/push/PushManager.js.map +1 -1
- package/lib/commonjs/push/adapters/NativeBridgeAdapter.js +1 -1
- package/lib/commonjs/push/adapters/NativeBridgeAdapter.js.map +1 -1
- package/lib/commonjs/push/native/nativeNotifications.js +7 -18
- package/lib/commonjs/push/native/nativeNotifications.js.map +1 -1
- package/lib/commonjs/storage/StorageBackend.js +1 -1
- package/lib/commonjs/storage/StorageBackend.js.map +1 -1
- package/lib/module/bootstrap/FeatureRegistry.js +4 -4
- package/lib/module/bootstrap/FeatureRegistry.js.map +1 -1
- package/lib/module/bootstrap/SDKBootstrapper.js +20 -17
- package/lib/module/bootstrap/SDKBootstrapper.js.map +1 -1
- package/lib/module/compat/codepush.js +77 -14
- package/lib/module/compat/codepush.js.map +1 -1
- package/lib/module/core/config/schema.js +411 -218
- package/lib/module/core/config/schema.js.map +1 -1
- package/lib/module/core/constants/endpoints.js +9 -6
- package/lib/module/core/constants/endpoints.js.map +1 -1
- package/lib/module/core/constants/protocol.js +25 -0
- package/lib/module/core/constants/protocol.js.map +1 -0
- package/lib/module/core/constants/timings.js +3 -1
- package/lib/module/core/constants/timings.js.map +1 -1
- package/lib/module/core/lifecycle/appLifecycle.js +1 -1
- package/lib/module/core/lifecycle/appLifecycle.js.map +1 -1
- package/lib/module/debug/bootstrap.js +30 -9
- package/lib/module/debug/bootstrap.js.map +1 -1
- package/lib/module/debug/exportBridge.js +5 -3
- package/lib/module/debug/exportBridge.js.map +1 -1
- package/lib/module/debug/hostResolver.js +2 -2
- package/lib/module/debug/hostResolver.js.map +1 -1
- package/lib/module/debug/perfWiring.js +4 -4
- package/lib/module/debug/perfWiring.js.map +1 -1
- package/lib/module/debug/replayWiring.js +5 -5
- package/lib/module/debug/replayWiring.js.map +1 -1
- package/lib/module/debug/screenTracking.js +2 -2
- package/lib/module/debug/screenTracking.js.map +1 -1
- package/lib/module/debug/sessionWiring.js +2 -2
- package/lib/module/debug/sessionWiring.js.map +1 -1
- package/lib/module/features/crash/NativeCrashFeature.js +1 -1
- package/lib/module/features/crash/NativeCrashFeature.js.map +1 -1
- package/lib/module/features/crash/globalHandler.js +3 -3
- package/lib/module/features/crash/globalHandler.js.map +1 -1
- package/lib/module/features/crash/nativeCrashBridge.js +7 -7
- package/lib/module/features/crash/nativeCrashBridge.js.map +1 -1
- package/lib/module/features/crash/rejectionHandler.js +2 -2
- package/lib/module/features/crash/rejectionHandler.js.map +1 -1
- package/lib/module/features/engage/EngageArchetypeRenderers.js +0 -8
- package/lib/module/features/engage/EngageArchetypeRenderers.js.map +1 -1
- package/lib/module/features/engage/EngageInAppView.js +1 -1
- package/lib/module/features/engage/EngageInAppView.js.map +1 -1
- package/lib/module/features/engage/EngagePromptProvider.js +17 -17
- package/lib/module/features/engage/EngagePromptProvider.js.map +1 -1
- package/lib/module/features/engage/EngageTransport.js +5 -5
- package/lib/module/features/engage/EngageTransport.js.map +1 -1
- package/lib/module/features/engage/engagePushTokenBridge.js +4 -4
- package/lib/module/features/engage/engagePushTokenBridge.js.map +1 -1
- package/lib/module/features/engage/engageShakeBridge.js +2 -2
- package/lib/module/features/engage/engageShakeBridge.js.map +1 -1
- package/lib/module/features/engage/engageSignals.js +1 -1
- package/lib/module/features/engage/engageSignals.js.map +1 -1
- package/lib/module/features/engage/engageStoreReviewBridge.js +2 -2
- package/lib/module/features/engage/engageStoreReviewBridge.js.map +1 -1
- package/lib/module/features/engage/engageTestSeenStore.js +1 -1
- package/lib/module/features/engage/engageTestSeenStore.js.map +1 -1
- package/lib/module/features/engage/engageThrottle.js +4 -4
- package/lib/module/features/engage/engageThrottle.js.map +1 -1
- package/lib/module/features/engage/engageTriggerEngine.js +4 -4
- package/lib/module/features/engage/engageTriggerEngine.js.map +1 -1
- package/lib/module/features/engage/engageWindowInsets.js +1 -1
- package/lib/module/features/engage/engageWindowInsets.js.map +1 -1
- package/lib/module/features/install-referrer/installReferrer.js +3 -3
- package/lib/module/features/install-referrer/installReferrer.js.map +1 -1
- package/lib/module/features/journey/calibrationContext.js +0 -8
- package/lib/module/features/journey/calibrationContext.js.map +1 -1
- package/lib/module/features/journey/journeyManager.js +3 -1
- package/lib/module/features/journey/journeyManager.js.map +1 -1
- package/lib/module/features/navigation/AutoScreenDetector.js +4 -4
- package/lib/module/features/navigation/AutoScreenDetector.js.map +1 -1
- package/lib/module/features/ota/OtaOrchestrator.js +27 -18
- package/lib/module/features/ota/OtaOrchestrator.js.map +1 -1
- package/lib/module/features/ota/geoCountry.js +2 -2
- package/lib/module/features/ota/geoCountry.js.map +1 -1
- package/lib/module/features/ota/retry.js +2 -2
- package/lib/module/features/ota/retry.js.map +1 -1
- package/lib/module/features/replay/core/logger/logger.js +0 -3
- package/lib/module/features/replay/core/logger/logger.js.map +1 -1
- package/lib/module/features/replay/integrations/network/networkAdapter.js +1 -52
- package/lib/module/features/replay/integrations/network/networkAdapter.js.map +1 -1
- package/lib/module/features/replay/integrations/react-navigation/navigationIntegration.js +1 -1
- package/lib/module/features/replay/integrations/react-navigation/navigationIntegration.js.map +1 -1
- package/lib/module/features/replay/integrations/touch/ReplayRoot.js +1 -1
- package/lib/module/features/replay/integrations/touch/ReplayRoot.js.map +1 -1
- package/lib/module/features/replay/pipeline/batching/batchManager.js +1 -1
- package/lib/module/features/replay/pipeline/batching/batchManager.js.map +1 -1
- package/lib/module/features/replay/pipeline/retry/retryPolicy.js +1 -1
- package/lib/module/features/replay/pipeline/retry/retryPolicy.js.map +1 -1
- package/lib/module/features/replay/public/api.js +7 -7
- package/lib/module/features/replay/public/api.js.map +1 -1
- package/lib/module/features/replay/replay/session/sessionOrchestrator.js +9 -9
- package/lib/module/features/replay/replay/session/sessionOrchestrator.js.map +1 -1
- package/lib/module/features/session/BackendSessionAdapter.js +41 -41
- package/lib/module/features/session/BackendSessionAdapter.js.map +1 -1
- package/lib/module/features/session/DesktopSessionTransport.js +4 -2
- package/lib/module/features/session/DesktopSessionTransport.js.map +1 -1
- package/lib/module/features/session/JourneyEventPipeline.js +1 -1
- package/lib/module/features/session/JourneyEventPipeline.js.map +1 -1
- package/lib/module/features/session/ReplayCaptureManager.js +14 -14
- package/lib/module/features/session/ReplayCaptureManager.js.map +1 -1
- package/lib/module/features/session/SessionManager.js +9 -9
- package/lib/module/features/session/SessionManager.js.map +1 -1
- package/lib/module/features/session/SyncDecisionEngine.js +1 -1
- package/lib/module/features/session/SyncDecisionEngine.js.map +1 -1
- package/lib/module/features/skan/skanBridge.js +6 -14
- package/lib/module/features/skan/skanBridge.js.map +1 -1
- package/lib/module/features/skan/skanConversionManager.js +5 -5
- package/lib/module/features/skan/skanConversionManager.js.map +1 -1
- package/lib/module/index.js +1 -1
- package/lib/module/integrations/fetch/fetchInterceptor.js +1 -1
- package/lib/module/integrations/fetch/fetchInterceptor.js.map +1 -1
- package/lib/module/integrations/xhr/xhrInterceptor.js +1 -1
- package/lib/module/integrations/xhr/xhrInterceptor.js.map +1 -1
- package/lib/module/metro/composeSourceMap.js +97 -0
- package/lib/module/metro/composeSourceMap.js.map +1 -0
- package/lib/module/metro/featureModules.js +123 -0
- package/lib/module/metro/featureModules.js.map +1 -0
- package/lib/module/metro/index.js +122 -2
- package/lib/module/metro/index.js.map +1 -1
- package/lib/module/metro/serializerCompose.js +120 -0
- package/lib/module/metro/serializerCompose.js.map +1 -0
- package/lib/module/pipeline/dispatcher/dispatcher.js +1 -1
- package/lib/module/pipeline/dispatcher/dispatcher.js.map +1 -1
- package/lib/module/pipeline/queue/flushQueue.js +2 -2
- package/lib/module/pipeline/queue/flushQueue.js.map +1 -1
- package/lib/module/pipeline/queue/persistentQueue.js +6 -36
- package/lib/module/pipeline/queue/persistentQueue.js.map +1 -1
- package/lib/module/pipeline/scheduler/flushScheduler.js +1 -1
- package/lib/module/pipeline/scheduler/flushScheduler.js.map +1 -1
- package/lib/module/public/ScaleBunFacade.js +64 -15
- package/lib/module/public/ScaleBunFacade.js.map +1 -1
- package/lib/module/push/PushManager.js +3 -3
- package/lib/module/push/PushManager.js.map +1 -1
- package/lib/module/push/adapters/NativeBridgeAdapter.js +1 -1
- package/lib/module/push/adapters/NativeBridgeAdapter.js.map +1 -1
- package/lib/module/push/native/nativeNotifications.js +7 -17
- package/lib/module/push/native/nativeNotifications.js.map +1 -1
- package/lib/module/storage/StorageBackend.js +1 -1
- package/lib/module/storage/StorageBackend.js.map +1 -1
- package/lib/typescript/bootstrap/SDKBootstrapper.d.ts.map +1 -1
- package/lib/typescript/compat/codepush.d.ts +27 -4
- package/lib/typescript/compat/codepush.d.ts.map +1 -1
- package/lib/typescript/core/config/schema.d.ts +61 -37
- package/lib/typescript/core/config/schema.d.ts.map +1 -1
- package/lib/typescript/core/constants/endpoints.d.ts +9 -6
- package/lib/typescript/core/constants/endpoints.d.ts.map +1 -1
- package/lib/typescript/core/constants/protocol.d.ts +23 -0
- package/lib/typescript/core/constants/protocol.d.ts.map +1 -0
- package/lib/typescript/core/constants/timings.d.ts +1 -1
- package/lib/typescript/core/constants/timings.d.ts.map +1 -1
- package/lib/typescript/debug/bootstrap.d.ts +0 -1
- package/lib/typescript/debug/bootstrap.d.ts.map +1 -1
- package/lib/typescript/debug/exportBridge.d.ts.map +1 -1
- package/lib/typescript/features/engage/EngageArchetypeRenderers.d.ts +0 -2
- package/lib/typescript/features/engage/EngageArchetypeRenderers.d.ts.map +1 -1
- package/lib/typescript/features/engage/EngageTransport.d.ts +1 -1
- package/lib/typescript/features/engage/EngageTransport.d.ts.map +1 -1
- package/lib/typescript/features/journey/calibrationContext.d.ts +0 -1
- package/lib/typescript/features/journey/calibrationContext.d.ts.map +1 -1
- package/lib/typescript/features/journey/journeyManager.d.ts.map +1 -1
- package/lib/typescript/features/ota/OtaOrchestrator.d.ts +6 -0
- package/lib/typescript/features/ota/OtaOrchestrator.d.ts.map +1 -1
- package/lib/typescript/features/replay/core/logger/logger.d.ts +0 -1
- package/lib/typescript/features/replay/core/logger/logger.d.ts.map +1 -1
- package/lib/typescript/features/replay/integrations/network/networkAdapter.d.ts +0 -10
- package/lib/typescript/features/replay/integrations/network/networkAdapter.d.ts.map +1 -1
- package/lib/typescript/features/session/DesktopSessionTransport.d.ts.map +1 -1
- package/lib/typescript/features/skan/skanBridge.d.ts +0 -2
- package/lib/typescript/features/skan/skanBridge.d.ts.map +1 -1
- package/lib/typescript/metro/composeSourceMap.d.ts +26 -0
- package/lib/typescript/metro/composeSourceMap.d.ts.map +1 -0
- package/lib/typescript/metro/featureModules.d.ts +49 -0
- package/lib/typescript/metro/featureModules.d.ts.map +1 -0
- package/lib/typescript/metro/index.d.ts +22 -0
- package/lib/typescript/metro/index.d.ts.map +1 -1
- package/lib/typescript/metro/serializerCompose.d.ts +46 -0
- package/lib/typescript/metro/serializerCompose.d.ts.map +1 -0
- package/lib/typescript/pipeline/queue/persistentQueue.d.ts +0 -10
- package/lib/typescript/pipeline/queue/persistentQueue.d.ts.map +1 -1
- package/lib/typescript/public/ScaleBunFacade.d.ts +11 -0
- package/lib/typescript/public/ScaleBunFacade.d.ts.map +1 -1
- package/lib/typescript/public/types.d.ts +34 -8
- package/lib/typescript/public/types.d.ts.map +1 -1
- package/lib/typescript/push/native/nativeNotifications.d.ts +0 -6
- package/lib/typescript/push/native/nativeNotifications.d.ts.map +1 -1
- package/package.json +15 -11
- package/src/bootstrap/FeatureRegistry.ts +4 -4
- package/src/bootstrap/SDKBootstrapper.ts +20 -17
- package/src/compat/codepush.ts +87 -16
- package/src/core/config/schema.ts +353 -222
- package/src/core/constants/endpoints.ts +9 -6
- package/src/core/constants/protocol.ts +24 -0
- package/src/core/constants/timings.ts +3 -1
- package/src/core/lifecycle/appLifecycle.ts +1 -1
- package/src/debug/bootstrap.ts +40 -7
- package/src/debug/exportBridge.ts +5 -3
- package/src/debug/hostResolver.ts +2 -2
- package/src/debug/perfWiring.ts +4 -4
- package/src/debug/replayWiring.ts +5 -5
- package/src/debug/screenTracking.ts +2 -2
- package/src/debug/sessionWiring.ts +2 -2
- package/src/features/crash/NativeCrashFeature.ts +1 -1
- package/src/features/crash/globalHandler.ts +3 -3
- package/src/features/crash/nativeCrashBridge.ts +7 -7
- package/src/features/crash/rejectionHandler.ts +2 -2
- package/src/features/engage/EngageArchetypeRenderers.tsx +0 -11
- package/src/features/engage/EngageInAppView.tsx +1 -1
- package/src/features/engage/EngagePromptProvider.tsx +17 -17
- package/src/features/engage/EngageTransport.ts +6 -6
- package/src/features/engage/engagePushTokenBridge.ts +4 -4
- package/src/features/engage/engageShakeBridge.ts +2 -2
- package/src/features/engage/engageSignals.ts +1 -1
- package/src/features/engage/engageStoreReviewBridge.ts +2 -2
- package/src/features/engage/engageTestSeenStore.ts +1 -1
- package/src/features/engage/engageThrottle.ts +4 -4
- package/src/features/engage/engageTriggerEngine.ts +4 -4
- package/src/features/engage/engageWindowInsets.ts +1 -1
- package/src/features/install-referrer/installReferrer.ts +3 -3
- package/src/features/journey/calibrationContext.ts +0 -9
- package/src/features/journey/journeyManager.ts +3 -1
- package/src/features/navigation/AutoScreenDetector.ts +4 -4
- package/src/features/ota/OtaOrchestrator.ts +27 -18
- package/src/features/ota/geoCountry.ts +2 -2
- package/src/features/ota/retry.ts +2 -2
- package/src/features/replay/core/logger/logger.ts +0 -4
- package/src/features/replay/integrations/network/networkAdapter.ts +1 -56
- package/src/features/replay/integrations/react-navigation/navigationIntegration.ts +1 -1
- package/src/features/replay/integrations/touch/ReplayRoot.tsx +1 -1
- package/src/features/replay/pipeline/batching/batchManager.ts +1 -1
- package/src/features/replay/pipeline/retry/retryPolicy.ts +1 -1
- package/src/features/replay/public/api.ts +7 -7
- package/src/features/replay/replay/session/sessionOrchestrator.ts +9 -9
- package/src/features/session/BackendSessionAdapter.ts +41 -41
- package/src/features/session/DesktopSessionTransport.ts +4 -2
- package/src/features/session/JourneyEventPipeline.ts +1 -1
- package/src/features/session/ReplayCaptureManager.ts +14 -14
- package/src/features/session/SessionManager.ts +9 -9
- package/src/features/session/SyncDecisionEngine.ts +1 -1
- package/src/features/skan/skanBridge.ts +6 -14
- package/src/features/skan/skanConversionManager.ts +5 -5
- package/src/index.ts +1 -1
- package/src/integrations/fetch/fetchInterceptor.ts +1 -1
- package/src/integrations/xhr/xhrInterceptor.ts +1 -1
- package/src/metro/composeSourceMap.ts +104 -0
- package/src/metro/featureModules.ts +143 -0
- package/src/metro/index.ts +173 -1
- package/src/metro/serializerCompose.ts +157 -0
- package/src/pipeline/dispatcher/dispatcher.ts +1 -1
- package/src/pipeline/queue/flushQueue.ts +2 -2
- package/src/pipeline/queue/persistentQueue.ts +6 -35
- package/src/pipeline/scheduler/flushScheduler.ts +1 -1
- package/src/public/ScaleBunFacade.ts +60 -15
- package/src/public/types.ts +35 -8
- package/src/push/PushManager.ts +3 -3
- package/src/push/adapters/NativeBridgeAdapter.ts +1 -1
- package/src/push/native/nativeNotifications.ts +7 -16
- package/src/storage/StorageBackend.ts +1 -1
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ScaleBun SDK — Debug-protocol constants needed OUTSIDE the debug lane.
|
|
3
|
+
*
|
|
4
|
+
* `PROTOCOL_VERSION` is stamped onto journey/session envelopes by production code
|
|
5
|
+
* (journeyManager, DesktopSessionTransport). Importing it from `vendor/protocol` — its canonical
|
|
6
|
+
* home — drags the whole vendored schema module into every production bundle, because that module
|
|
7
|
+
* builds all desktop wire-message schemas at module scope and Metro performs no tree shaking.
|
|
8
|
+
* Measured: 4,240 bytes of minified schema code shipped for the sake of two numeric constants.
|
|
9
|
+
*
|
|
10
|
+
* So the two constants are declared here, dependency-free, and production code imports THIS file.
|
|
11
|
+
* The vendored module keeps re-exporting its own copies for the debug lane, which is the only
|
|
12
|
+
* place the schemas themselves are used.
|
|
13
|
+
*
|
|
14
|
+
* The vendored file itself is deliberately untouched — `vendor/protocol` is a byte-identical copy
|
|
15
|
+
* of `@scalebun/protocol` enforced by parity gates, so the values are duplicated here rather than
|
|
16
|
+
* re-exported. `core/constants/__tests__/protocolConstants.test.ts` asserts both copies stay
|
|
17
|
+
* equal; if the canonical protocol bumps a value, that test fails until this file follows.
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
/** Wire-protocol version stamped on every desktop-debug and journey envelope. */
|
|
21
|
+
export const PROTOCOL_VERSION = 1;
|
|
22
|
+
|
|
23
|
+
/** Heartbeat interval sent in ACK; the SDK uses this for its ping timer. */
|
|
24
|
+
export const DEFAULT_HEARTBEAT_INTERVAL_MS = 5000;
|
|
@@ -5,7 +5,9 @@
|
|
|
5
5
|
* Import from here instead of using inline literals.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
// From the SDK-owned constants copy, NOT vendor/protocol — importing the vendored module here
|
|
9
|
+
// would ship every desktop wire-message schema in every production bundle. See ./protocol.ts.
|
|
10
|
+
export { DEFAULT_HEARTBEAT_INTERVAL_MS } from './protocol';
|
|
9
11
|
|
|
10
12
|
/** Default WebSocket port when no port is specified in DebugConfig */
|
|
11
13
|
export const DEFAULT_WS_PORT = 9333;
|
|
@@ -12,7 +12,7 @@ class AppLifecycle {
|
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
private handleStateChange = (nextState: AppStateStatus) => {
|
|
15
|
-
logger.debug(`App state changed: ${this.currentState} -> ${nextState}`);
|
|
15
|
+
__DEV__ && logger.debug(`App state changed: ${this.currentState} -> ${nextState}`);
|
|
16
16
|
this.currentState = nextState;
|
|
17
17
|
this.listeners.forEach((l) => l(nextState));
|
|
18
18
|
};
|
package/src/debug/bootstrap.ts
CHANGED
|
@@ -85,6 +85,22 @@ let _autoScreenDetector: AutoScreenDetector | null = null;
|
|
|
85
85
|
|
|
86
86
|
// ─── Public API ─────────────────────────────────────────────────────────────
|
|
87
87
|
|
|
88
|
+
/**
|
|
89
|
+
* Is the desktop-debugger tooling present in this bundle?
|
|
90
|
+
*
|
|
91
|
+
* When `features: { devTools: false }` is set in metro.config.js these modules resolve to an empty
|
|
92
|
+
* stub, so their exports are `undefined`. Checked as values rather than via a build-time flag
|
|
93
|
+
* because the answer is a property of how the bundle was resolved, which no runtime flag can know.
|
|
94
|
+
*/
|
|
95
|
+
function isDevToolsBundled(): boolean {
|
|
96
|
+
return (
|
|
97
|
+
typeof DebugTransport === 'function' &&
|
|
98
|
+
typeof DebugEventStream === 'function' &&
|
|
99
|
+
typeof CommandRegistry === 'function' &&
|
|
100
|
+
typeof resolveDebugHost === 'function'
|
|
101
|
+
);
|
|
102
|
+
}
|
|
103
|
+
|
|
88
104
|
/**
|
|
89
105
|
* Enable the debug subsystem. Connects to the desktop app over WebSocket
|
|
90
106
|
* and starts streaming SDK events.
|
|
@@ -94,13 +110,29 @@ let _autoScreenDetector: AutoScreenDetector | null = null;
|
|
|
94
110
|
export function enableDebug(config: DebugConfig): void {
|
|
95
111
|
try {
|
|
96
112
|
if (_enabled) {
|
|
97
|
-
logger.debug('Debug already enabled, skipping');
|
|
113
|
+
__DEV__ && logger.debug('Debug already enabled, skipping');
|
|
114
|
+
return;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
// The desktop-debugger tooling can be excluded from a build via
|
|
118
|
+
// `withScaleBun(config, { features: { devTools: false } })`, which resolves these modules
|
|
119
|
+
// to an empty stub. Detect that explicitly: without this check the first `new
|
|
120
|
+
// DebugTransport(...)` throws "not a constructor", the catch below reports it as a failure
|
|
121
|
+
// to enable debug, and the real cause — a deliberate build-time opt-out — is three layers
|
|
122
|
+
// from the message the developer reads.
|
|
123
|
+
if (!isDevToolsBundled()) {
|
|
124
|
+
logger.warn(
|
|
125
|
+
'[ScaleBun] debugConnection was configured, but the desktop-debugger tooling is not ' +
|
|
126
|
+
'in this bundle. It is excluded by default (the ScaleBun desktop app is not yet ' +
|
|
127
|
+
'released); opt in with `withScaleBun(config, { features: { devTools: true } })` ' +
|
|
128
|
+
'in metro.config.js. All other SDK behaviour is unaffected.',
|
|
129
|
+
);
|
|
98
130
|
return;
|
|
99
131
|
}
|
|
100
132
|
|
|
101
133
|
const host = resolveDebugHost(config.host);
|
|
102
134
|
const port = config.port ?? DEFAULT_WS_PORT;
|
|
103
|
-
logger.debug(`Enabling debug transport → ws://${host}:${port}`);
|
|
135
|
+
__DEV__ && logger.debug(`Enabling debug transport → ws://${host}:${port}`);
|
|
104
136
|
|
|
105
137
|
// Store journey config
|
|
106
138
|
_journeyConfig = {
|
|
@@ -202,7 +234,7 @@ export function enableDebug(config: DebugConfig): void {
|
|
|
202
234
|
|
|
203
235
|
// Transport events
|
|
204
236
|
_transport.onStateChange((state) => {
|
|
205
|
-
logger.debug(`[Debug Transport] State → ${state}`);
|
|
237
|
+
__DEV__ && logger.debug(`[Debug Transport] State → ${state}`);
|
|
206
238
|
});
|
|
207
239
|
|
|
208
240
|
// Connect and install
|
|
@@ -215,7 +247,7 @@ export function enableDebug(config: DebugConfig): void {
|
|
|
215
247
|
|
|
216
248
|
_enabled = true;
|
|
217
249
|
_debugReady = true;
|
|
218
|
-
logger.info(`Debug enabled → ws://${host}:${port}`);
|
|
250
|
+
__DEV__ && logger.info(`Debug enabled → ws://${host}:${port}`);
|
|
219
251
|
|
|
220
252
|
// Auto native capture wiring
|
|
221
253
|
wireNativeCaptureDeferred(() => _sessionManager);
|
|
@@ -232,7 +264,7 @@ export function enableDebug(config: DebugConfig): void {
|
|
|
232
264
|
navMode: _autoScreenDetector ? 'auto' : 'beacon',
|
|
233
265
|
sdkVersion: '1.0.0',
|
|
234
266
|
});
|
|
235
|
-
logger.debug('Emitted journey:debug_ready event to desktop');
|
|
267
|
+
__DEV__ && logger.debug('Emitted journey:debug_ready event to desktop');
|
|
236
268
|
} catch { /* no-throw */ }
|
|
237
269
|
}, DEBUG_READY_EMIT_DELAY_MS);
|
|
238
270
|
} catch (e) {
|
|
@@ -312,7 +344,6 @@ export function _isJourneyEnabled(): boolean { return _journeyConfig.enabled; }
|
|
|
312
344
|
/** @internal */
|
|
313
345
|
export function _setDebugReady(ready: boolean): void { _debugReady = ready; }
|
|
314
346
|
/** @internal */
|
|
315
|
-
export function _isDebugReady(): boolean { return _debugReady; }
|
|
316
347
|
/** @internal */
|
|
317
348
|
export function _getSessionManager(): SessionManagerType | null { return _sessionManager; }
|
|
318
349
|
/** @internal */
|
|
@@ -329,7 +360,9 @@ export { setTrackedScreen, getTrackedScreen } from './screenTracking';
|
|
|
329
360
|
export function _emitJourneyEvent(name: string, data: Record<string, unknown>): void {
|
|
330
361
|
if (!_transport || !_enabled) return;
|
|
331
362
|
try {
|
|
332
|
-
|
|
363
|
+
// From the SDK-owned constants module — requiring './protocol' here would statically drag
|
|
364
|
+
// the vendored schema module into every bundle, even ones that exclude the debug tooling.
|
|
365
|
+
const { PROTOCOL_VERSION } = require('../core/constants/protocol');
|
|
333
366
|
const msg = {
|
|
334
367
|
type: 'event' as const,
|
|
335
368
|
protocolVersion: PROTOCOL_VERSION,
|
|
@@ -83,7 +83,9 @@ export function requestExport(
|
|
|
83
83
|
_pendingExports.set(requestId, { requestId, resolve, reject, timer });
|
|
84
84
|
|
|
85
85
|
// Send export request event to desktop
|
|
86
|
-
|
|
86
|
+
// From the SDK-owned constants module — requiring './protocol' here would statically
|
|
87
|
+
// drag the vendored schema module into every bundle, even devtools-excluded ones.
|
|
88
|
+
const { PROTOCOL_VERSION } = require('../core/constants/protocol');
|
|
87
89
|
transport.send({
|
|
88
90
|
type: 'event' as const,
|
|
89
91
|
protocolVersion: PROTOCOL_VERSION,
|
|
@@ -99,7 +101,7 @@ export function requestExport(
|
|
|
99
101
|
},
|
|
100
102
|
} as any);
|
|
101
103
|
|
|
102
|
-
logger.info(`[ExportBridge] Export request sent: ${requestId}`);
|
|
104
|
+
__DEV__ && logger.info(`[ExportBridge] Export request sent: ${requestId}`);
|
|
103
105
|
|
|
104
106
|
} catch (err: any) {
|
|
105
107
|
resolve({
|
|
@@ -135,7 +137,7 @@ export function handleExportResult(args: Record<string, unknown>): void {
|
|
|
135
137
|
cancelled: args.cancelled as boolean | undefined,
|
|
136
138
|
});
|
|
137
139
|
|
|
138
|
-
logger.info(`[ExportBridge] Export result received: ${requestId} success=${args.success}`);
|
|
140
|
+
__DEV__ && logger.info(`[ExportBridge] Export result received: ${requestId} success=${args.success}`);
|
|
139
141
|
} catch { /* no-throw */ }
|
|
140
142
|
}
|
|
141
143
|
|
|
@@ -15,7 +15,7 @@ import { logger } from '../core/logger/internalLogger';
|
|
|
15
15
|
*/
|
|
16
16
|
export function resolveDebugHost(explicit?: string): string {
|
|
17
17
|
if (explicit) {
|
|
18
|
-
logger.debug(`Debug host: explicit → ${explicit}`);
|
|
18
|
+
__DEV__ && logger.debug(`Debug host: explicit → ${explicit}`);
|
|
19
19
|
return explicit;
|
|
20
20
|
}
|
|
21
21
|
// Android emulator needs 10.0.2.2 to reach host machine's loopback.
|
|
@@ -29,6 +29,6 @@ export function resolveDebugHost(explicit?: string): string {
|
|
|
29
29
|
} catch {
|
|
30
30
|
// Fallback to localhost if Platform is unavailable
|
|
31
31
|
}
|
|
32
|
-
logger.debug(`Debug host: auto → ${host}`);
|
|
32
|
+
__DEV__ && logger.debug(`Debug host: auto → ${host}`);
|
|
33
33
|
return host;
|
|
34
34
|
}
|
package/src/debug/perfWiring.ts
CHANGED
|
@@ -33,7 +33,7 @@ export function initPerformance(
|
|
|
33
33
|
},
|
|
34
34
|
): { performanceFeature: PerformanceFeature | null; perfMonitor: PerfMonitor | null } {
|
|
35
35
|
if (config.performanceDisabled) {
|
|
36
|
-
logger.debug('Performance feature disabled — skipping PerformanceFeature init');
|
|
36
|
+
__DEV__ && logger.debug('Performance feature disabled — skipping PerformanceFeature init');
|
|
37
37
|
return { performanceFeature: null, perfMonitor: null };
|
|
38
38
|
}
|
|
39
39
|
|
|
@@ -69,7 +69,7 @@ export function initPerformance(
|
|
|
69
69
|
});
|
|
70
70
|
|
|
71
71
|
initPromise.then(() => {
|
|
72
|
-
logger.info('PerformanceFeature initialized successfully');
|
|
72
|
+
__DEV__ && logger.info('PerformanceFeature initialized successfully');
|
|
73
73
|
}).catch((perfErr: any) => {
|
|
74
74
|
logger.warn('PerformanceFeature async init failed:', perfErr?.message);
|
|
75
75
|
});
|
|
@@ -96,7 +96,7 @@ export function initProfiler(
|
|
|
96
96
|
enableProfiler?: boolean,
|
|
97
97
|
): ProfilerFeature | null {
|
|
98
98
|
if (enableProfiler === false) {
|
|
99
|
-
logger.debug('Profiler feature disabled — skipping ProfilerFeature init');
|
|
99
|
+
__DEV__ && logger.debug('Profiler feature disabled — skipping ProfilerFeature init');
|
|
100
100
|
return null;
|
|
101
101
|
}
|
|
102
102
|
|
|
@@ -106,7 +106,7 @@ export function initProfiler(
|
|
|
106
106
|
profilerFeature.setSessionId(transport.sessionId);
|
|
107
107
|
|
|
108
108
|
profilerFeature.initialize().then(() => {
|
|
109
|
-
logger.info('ProfilerFeature initialized successfully (idle state)');
|
|
109
|
+
__DEV__ && logger.info('ProfilerFeature initialized successfully (idle state)');
|
|
110
110
|
}).catch((initErr: any) => {
|
|
111
111
|
logger.warn('ProfilerFeature init failed (non-fatal, native module may not be present):', initErr?.message);
|
|
112
112
|
});
|
|
@@ -28,13 +28,13 @@ export function initReplaySdk(
|
|
|
28
28
|
transport: DebugTransport,
|
|
29
29
|
): void {
|
|
30
30
|
if (replayConfig === undefined) {
|
|
31
|
-
logger.debug('Replay feature disabled — skipping replay-sdk init');
|
|
31
|
+
__DEV__ && logger.debug('Replay feature disabled — skipping replay-sdk init');
|
|
32
32
|
return;
|
|
33
33
|
}
|
|
34
34
|
try {
|
|
35
35
|
ReplaySdk.init(replayConfig, { debugTransport: transport }).then(() => {
|
|
36
36
|
_replaySdkInitialized = true;
|
|
37
|
-
logger.info('Replay SDK initialized with desktop transport');
|
|
37
|
+
__DEV__ && logger.info('Replay SDK initialized with desktop transport');
|
|
38
38
|
}).catch((err: any) => {
|
|
39
39
|
logger.warn('Replay SDK init failed (non-fatal):', err?.message);
|
|
40
40
|
});
|
|
@@ -53,7 +53,7 @@ export function wireNativeCaptureDeferred(
|
|
|
53
53
|
getSessionManager: () => SessionManagerType | null,
|
|
54
54
|
): void {
|
|
55
55
|
if (_nativeCaptureWired) {
|
|
56
|
-
logger.debug('[AutoCapture] Already wired — skipping');
|
|
56
|
+
__DEV__ && logger.debug('[AutoCapture] Already wired — skipping');
|
|
57
57
|
return;
|
|
58
58
|
}
|
|
59
59
|
|
|
@@ -101,7 +101,7 @@ export function wireNativeCaptureDeferred(
|
|
|
101
101
|
if (typeof (sessionManager as any).setNativeCapture === 'function') {
|
|
102
102
|
(sessionManager as any).setNativeCapture(nativeBridgeCapture);
|
|
103
103
|
_nativeCaptureWired = true;
|
|
104
|
-
logger.info('[AutoCapture] ✅ Native bridge capture wired (bridgeAdapter)');
|
|
104
|
+
__DEV__ && logger.info('[AutoCapture] ✅ Native bridge capture wired (bridgeAdapter)');
|
|
105
105
|
return;
|
|
106
106
|
}
|
|
107
107
|
}
|
|
@@ -111,7 +111,7 @@ export function wireNativeCaptureDeferred(
|
|
|
111
111
|
|
|
112
112
|
// Fallback: SessionManager was already created with nativeCapture
|
|
113
113
|
_nativeCaptureWired = true;
|
|
114
|
-
logger.info('[AutoCapture] ✅ Native capture available via SessionManager bootstrap');
|
|
114
|
+
__DEV__ && logger.info('[AutoCapture] ✅ Native capture available via SessionManager bootstrap');
|
|
115
115
|
|
|
116
116
|
} catch (err: any) {
|
|
117
117
|
logger.warn('[AutoCapture] Wiring failed:', err?.message);
|
|
@@ -41,12 +41,12 @@ export function startAutoScreenDetection(): AutoScreenDetector | null {
|
|
|
41
41
|
detector.onScreenChange((screenName, source) => {
|
|
42
42
|
// Update cross-cutting screen tracker
|
|
43
43
|
setTrackedScreen(screenName);
|
|
44
|
-
logger.debug(`[AutoScreenDebug] Screen mirrored → '${screenName}' (source: ${source})`);
|
|
44
|
+
__DEV__ && logger.debug(`[AutoScreenDebug] Screen mirrored → '${screenName}' (source: ${source})`);
|
|
45
45
|
});
|
|
46
46
|
|
|
47
47
|
// Ensure it's started in case debug connects before SDKBootstrapper finishes
|
|
48
48
|
detector.start();
|
|
49
|
-
logger.info('[AutoScreen] Auto screen detection debug-mirror started');
|
|
49
|
+
__DEV__ && logger.info('[AutoScreen] Auto screen detection debug-mirror started');
|
|
50
50
|
return detector;
|
|
51
51
|
} catch (err: any) {
|
|
52
52
|
logger.warn('[AutoScreen] Failed to start debug-mirror:', err?.message);
|
|
@@ -24,7 +24,7 @@ export function createSessionManager(
|
|
|
24
24
|
sessionDisabled?: boolean,
|
|
25
25
|
): SessionManagerType | null {
|
|
26
26
|
if (sessionDisabled) {
|
|
27
|
-
logger.debug('Session feature disabled — skipping SessionManager');
|
|
27
|
+
__DEV__ && logger.debug('Session feature disabled — skipping SessionManager');
|
|
28
28
|
return null;
|
|
29
29
|
}
|
|
30
30
|
|
|
@@ -47,7 +47,7 @@ export function createSessionManager(
|
|
|
47
47
|
// Attach desktop transport
|
|
48
48
|
sessionManager.setDesktopTransport(transport);
|
|
49
49
|
commands.setSessionManager(sessionManager);
|
|
50
|
-
logger.info('Session manager wired for debug (desktop transport attached)');
|
|
50
|
+
__DEV__ && logger.info('Session manager wired for debug (desktop transport attached)');
|
|
51
51
|
|
|
52
52
|
return sessionManager;
|
|
53
53
|
|
|
@@ -25,7 +25,7 @@ export class NativeCrashFeature implements IFeature {
|
|
|
25
25
|
drainNativeCrash()
|
|
26
26
|
.then((found) => {
|
|
27
27
|
if (found) {
|
|
28
|
-
logger.info('[NativeCrashFeature] Previous native crash queued for upload');
|
|
28
|
+
__DEV__ && logger.info('[NativeCrashFeature] Previous native crash queued for upload');
|
|
29
29
|
}
|
|
30
30
|
})
|
|
31
31
|
.catch(() => {});
|
|
@@ -17,14 +17,14 @@ export function installGlobalHandler(onCrash: (error: Error, isFatal: boolean) =
|
|
|
17
17
|
noThrow(() => {
|
|
18
18
|
const errorUtils = (globalThis as any).ErrorUtils;
|
|
19
19
|
if (!errorUtils || typeof errorUtils.getGlobalHandler !== 'function') {
|
|
20
|
-
logger.debug('[Crash] ErrorUtils unavailable — global JS error handler not installed');
|
|
20
|
+
__DEV__ && logger.debug('[Crash] ErrorUtils unavailable — global JS error handler not installed');
|
|
21
21
|
return;
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
const originalHandler = errorUtils.getGlobalHandler();
|
|
25
25
|
|
|
26
26
|
errorUtils.setGlobalHandler((error: any, isFatal?: boolean) => {
|
|
27
|
-
logger.debug('Caught global error:', error?.message);
|
|
27
|
+
__DEV__ && logger.debug('Caught global error:', error?.message);
|
|
28
28
|
|
|
29
29
|
onCrash(error, !!isFatal);
|
|
30
30
|
|
|
@@ -34,6 +34,6 @@ export function installGlobalHandler(onCrash: (error: Error, isFatal: boolean) =
|
|
|
34
34
|
}
|
|
35
35
|
});
|
|
36
36
|
|
|
37
|
-
logger.debug('Global error handler installed');
|
|
37
|
+
__DEV__ && logger.debug('Global error handler installed');
|
|
38
38
|
});
|
|
39
39
|
}
|
|
@@ -23,7 +23,7 @@ function getCrashModule(): any {
|
|
|
23
23
|
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
24
24
|
const turbo = require('../../specs/NativeScaleBunCrash').default;
|
|
25
25
|
if (turbo) {
|
|
26
|
-
logger.debug(`[NativeCrash] resolved via ${nativeModuleVia()}`);
|
|
26
|
+
__DEV__ && logger.debug(`[NativeCrash] resolved via ${nativeModuleVia()}`);
|
|
27
27
|
_crashModule = { mod: turbo };
|
|
28
28
|
return turbo;
|
|
29
29
|
}
|
|
@@ -58,7 +58,7 @@ export async function setNativeActiveSession(sessionId: string): Promise<void> {
|
|
|
58
58
|
const mod = getCrashModule();
|
|
59
59
|
if (!mod?.setActiveSessionId || !sessionId) return;
|
|
60
60
|
await mod.setActiveSessionId(sessionId);
|
|
61
|
-
logger.debug(`[NativeCrash] Active session → ${sessionId}`);
|
|
61
|
+
__DEV__ && logger.debug(`[NativeCrash] Active session → ${sessionId}`);
|
|
62
62
|
} catch {
|
|
63
63
|
// No-throw
|
|
64
64
|
}
|
|
@@ -68,11 +68,11 @@ export async function installNativeCrashHandler(): Promise<void> {
|
|
|
68
68
|
try {
|
|
69
69
|
const mod = getCrashModule();
|
|
70
70
|
if (!mod?.install) {
|
|
71
|
-
logger.debug('[NativeCrash] Native module not available — skipping install');
|
|
71
|
+
__DEV__ && logger.debug('[NativeCrash] Native module not available — skipping install');
|
|
72
72
|
return;
|
|
73
73
|
}
|
|
74
74
|
await mod.install();
|
|
75
|
-
logger.debug('[NativeCrash] Handler installed');
|
|
75
|
+
__DEV__ && logger.debug('[NativeCrash] Handler installed');
|
|
76
76
|
} catch {
|
|
77
77
|
// No-throw
|
|
78
78
|
}
|
|
@@ -199,17 +199,17 @@ async function drainOne(seen: Set<string>): Promise<'none' | 'cleared' | 'kept'>
|
|
|
199
199
|
const crashId = seenKey;
|
|
200
200
|
if (!crashId) {
|
|
201
201
|
await mod.clearPendingCrash?.('');
|
|
202
|
-
logger.info('[NativeCrash] Legacy crash (no id) drained and cleared');
|
|
202
|
+
__DEV__ && logger.info('[NativeCrash] Legacy crash (no id) drained and cleared');
|
|
203
203
|
return 'cleared';
|
|
204
204
|
}
|
|
205
205
|
|
|
206
206
|
const delivered = await confirmDelivery();
|
|
207
207
|
if (delivered) {
|
|
208
208
|
await mod.clearPendingCrash?.(crashId);
|
|
209
|
-
logger.info(`[NativeCrash] Crash ${crashId} delivered → cleared`);
|
|
209
|
+
__DEV__ && logger.info(`[NativeCrash] Crash ${crashId} delivered → cleared`);
|
|
210
210
|
return 'cleared';
|
|
211
211
|
}
|
|
212
|
-
logger.info(`[NativeCrash] Crash ${crashId} not yet delivered → kept for retry`);
|
|
212
|
+
__DEV__ && logger.info(`[NativeCrash] Crash ${crashId} not yet delivered → kept for retry`);
|
|
213
213
|
return 'kept';
|
|
214
214
|
} catch {
|
|
215
215
|
// Unknown state — stop the loop rather than risk spinning on a failure we cannot diagnose.
|
|
@@ -69,7 +69,7 @@ export function installRejectionHandler(
|
|
|
69
69
|
noThrow(() => {
|
|
70
70
|
const tracker = (deps?.resolveTracker ?? defaultResolveTracker)();
|
|
71
71
|
if (!tracker || typeof tracker.enable !== 'function') {
|
|
72
|
-
logger.debug(
|
|
72
|
+
__DEV__ && logger.debug(
|
|
73
73
|
'[Crash] promise rejection tracking unavailable — unhandled rejections not captured',
|
|
74
74
|
);
|
|
75
75
|
return false;
|
|
@@ -107,7 +107,7 @@ export function installRejectionHandler(
|
|
|
107
107
|
},
|
|
108
108
|
});
|
|
109
109
|
|
|
110
|
-
logger.debug('Unhandled promise rejection handler installed');
|
|
110
|
+
__DEV__ && logger.debug('Unhandled promise rejection handler installed');
|
|
111
111
|
return true;
|
|
112
112
|
}) ?? false
|
|
113
113
|
);
|
|
@@ -3703,14 +3703,3 @@ export const ARCHETYPE_RENDERERS: Record<string, ArchetypeRenderer> = {
|
|
|
3703
3703
|
celebration_confetti_full_screen: CelebrationInApp,
|
|
3704
3704
|
};
|
|
3705
3705
|
|
|
3706
|
-
/** Resolve archetype renderer if spec.archetype is a known mechanic key. */
|
|
3707
|
-
export function resolveArchetypeRenderer(
|
|
3708
|
-
archetype?: string,
|
|
3709
|
-
): ArchetypeRenderer | null {
|
|
3710
|
-
if (!archetype) return null;
|
|
3711
|
-
const familyRenderer = resolveArchetypeContent(archetype);
|
|
3712
|
-
if (familyRenderer) return familyRenderer;
|
|
3713
|
-
return Object.prototype.hasOwnProperty.call(ARCHETYPE_RENDERERS, archetype)
|
|
3714
|
-
? (ARCHETYPE_RENDERERS[archetype] ?? null)
|
|
3715
|
-
: null;
|
|
3716
|
-
}
|
|
@@ -2062,7 +2062,7 @@ export function EngageInAppView({
|
|
|
2062
2062
|
const Branch = resolveInAppPresentationRenderer(presentation, mountModelOverride);
|
|
2063
2063
|
const theme = resolveTheme(effectiveSpec);
|
|
2064
2064
|
if (__DEV__) {
|
|
2065
|
-
logger.debug(
|
|
2065
|
+
__DEV__ && logger.debug(
|
|
2066
2066
|
`[Engage] in-app ${message.id} rendering variant="${presentation.variantKey ?? 'legacy'}" archetype="${presentation.archetype}" mount="${effectiveMountModel}" layout="${presentation.legacyLayout}" fallback="${presentation.fallback?.reason ?? 'none'}"${message.isTest ? ` (test ${message.testRunId ?? message.previewId ?? message.id})` : ''}`,
|
|
2067
2067
|
);
|
|
2068
2068
|
}
|
|
@@ -467,7 +467,7 @@ export function EngagePromptProvider({
|
|
|
467
467
|
deviceId: getDeviceId(),
|
|
468
468
|
});
|
|
469
469
|
} catch (err) {
|
|
470
|
-
logger.debug('[Engage] trackEvent failed:', (err as Error)?.message);
|
|
470
|
+
__DEV__ && logger.debug('[Engage] trackEvent failed:', (err as Error)?.message);
|
|
471
471
|
}
|
|
472
472
|
},
|
|
473
473
|
[engage],
|
|
@@ -487,7 +487,7 @@ export function EngagePromptProvider({
|
|
|
487
487
|
screen: activeScreenRef.current,
|
|
488
488
|
});
|
|
489
489
|
} catch (err) {
|
|
490
|
-
logger.debug('[Engage] survey impression failed:', (err as Error)?.message);
|
|
490
|
+
__DEV__ && logger.debug('[Engage] survey impression failed:', (err as Error)?.message);
|
|
491
491
|
}
|
|
492
492
|
},
|
|
493
493
|
[engage],
|
|
@@ -517,7 +517,7 @@ export function EngagePromptProvider({
|
|
|
517
517
|
dims: currentRatingDims(),
|
|
518
518
|
});
|
|
519
519
|
} catch (err) {
|
|
520
|
-
logger.debug('[Engage] emitRatingEvent failed:', (err as Error)?.message);
|
|
520
|
+
__DEV__ && logger.debug('[Engage] emitRatingEvent failed:', (err as Error)?.message);
|
|
521
521
|
}
|
|
522
522
|
},
|
|
523
523
|
[engage],
|
|
@@ -718,7 +718,7 @@ export function EngagePromptProvider({
|
|
|
718
718
|
if (!campaign) {
|
|
719
719
|
// Name the inputs so a silent mismatch (wrong trigger name, throttle
|
|
720
720
|
// suppression, type filter) is diagnosable from device logs alone.
|
|
721
|
-
logger.debug(
|
|
721
|
+
__DEV__ && logger.debug(
|
|
722
722
|
`[Engage] no eligible campaign to render (trigger=${options?.trigger ?? '—'} ` +
|
|
723
723
|
`candidates=${config.campaigns.length} ` +
|
|
724
724
|
`[${config.campaigns.map((c) => `${c.type}:${c.trigger ?? '—'}`).join(', ')}])`,
|
|
@@ -804,7 +804,7 @@ export function EngagePromptProvider({
|
|
|
804
804
|
...(Object.keys(meta).length > 0 ? { meta } : {}),
|
|
805
805
|
});
|
|
806
806
|
} catch (err) {
|
|
807
|
-
logger.debug('[Engage] in-app trackEvent failed:', (err as Error)?.message);
|
|
807
|
+
__DEV__ && logger.debug('[Engage] in-app trackEvent failed:', (err as Error)?.message);
|
|
808
808
|
}
|
|
809
809
|
},
|
|
810
810
|
[engage],
|
|
@@ -827,7 +827,7 @@ export function EngagePromptProvider({
|
|
|
827
827
|
// Eager-flush so the backend consumes the one-shot preview row NOW — a fast
|
|
828
828
|
// close→kill→reopen must not re-serve a still-`delivered` test.
|
|
829
829
|
engage.flushEvents?.();
|
|
830
|
-
logger.debug(`[Engage] test ${runId} render displayed — ACK sent (impression), flushed`);
|
|
830
|
+
__DEV__ && logger.debug(`[Engage] test ${runId} render displayed — ACK sent (impression), flushed`);
|
|
831
831
|
}
|
|
832
832
|
},
|
|
833
833
|
[trackInApp, engage],
|
|
@@ -838,19 +838,19 @@ export function EngagePromptProvider({
|
|
|
838
838
|
if (current) {
|
|
839
839
|
const isTest = current.preview === true || current.isTest === true;
|
|
840
840
|
const runId = current.testRunId ?? current.previewId ?? current.id;
|
|
841
|
-
logger.debug(`[Engage] in-app ${eventType}${isTest ? ` (test ${runId})` : ''}`);
|
|
841
|
+
__DEV__ && logger.debug(`[Engage] in-app ${eventType}${isTest ? ` (test ${runId})` : ''}`);
|
|
842
842
|
trackInApp(current, eventType);
|
|
843
843
|
if (isTest) {
|
|
844
844
|
consumedPreviewIds.current.add(current.previewId ?? current.id);
|
|
845
845
|
seenTestsRef.current?.markSeen(runId);
|
|
846
846
|
engage.flushEvents?.();
|
|
847
|
-
logger.debug(`[Engage] test ${runId} ${eventType} persisted + ACK flushed`);
|
|
847
|
+
__DEV__ && logger.debug(`[Engage] test ${runId} ${eventType} persisted + ACK flushed`);
|
|
848
848
|
} else {
|
|
849
849
|
// Stamp the SERVED revision: without it the completion can never be invalidated,
|
|
850
850
|
// and an edited campaign would never return to a device that closed the old one.
|
|
851
851
|
storeRef.current?.markCompleted(current.id, Date.now(), current.revision);
|
|
852
852
|
engage.flushEvents?.();
|
|
853
|
-
logger.debug(`[Engage] in-app ${current.id} ${eventType} — marked done on device`);
|
|
853
|
+
__DEV__ && logger.debug(`[Engage] in-app ${current.id} ${eventType} — marked done on device`);
|
|
854
854
|
}
|
|
855
855
|
}
|
|
856
856
|
return null;
|
|
@@ -899,12 +899,12 @@ export function EngagePromptProvider({
|
|
|
899
899
|
consumedPreviewIds.current.add(message.previewId ?? message.id);
|
|
900
900
|
seenTestsRef.current?.markSeen(runId);
|
|
901
901
|
engage.flushEvents?.();
|
|
902
|
-
logger.debug(`[Engage] test ${runId} CTA — persisted locally + ACK flushed`);
|
|
902
|
+
__DEV__ && logger.debug(`[Engage] test ${runId} CTA — persisted locally + ACK flushed`);
|
|
903
903
|
} else {
|
|
904
904
|
// Production message: a CTA tap is as final as a close — don't re-show it.
|
|
905
905
|
storeRef.current?.markCompleted(message.id, Date.now(), message.revision);
|
|
906
906
|
engage.flushEvents?.();
|
|
907
|
-
logger.debug(`[Engage] in-app ${message.id} CTA tapped — marked done on device`);
|
|
907
|
+
__DEV__ && logger.debug(`[Engage] in-app ${message.id} CTA tapped — marked done on device`);
|
|
908
908
|
}
|
|
909
909
|
setActiveInApp(null);
|
|
910
910
|
// Any enabled click event above already read the arm; clear it now.
|
|
@@ -938,7 +938,7 @@ export function EngagePromptProvider({
|
|
|
938
938
|
// PRECEDENCE: a campaign prompt owns the screen — defer (the backend re-serves
|
|
939
939
|
// the preview on every poll until TTL, so the next foreground retries).
|
|
940
940
|
if (active !== null) {
|
|
941
|
-
logger.debug('[Engage] campaign prompt active — preview deferred');
|
|
941
|
+
__DEV__ && logger.debug('[Engage] campaign prompt active — preview deferred');
|
|
942
942
|
return false;
|
|
943
943
|
}
|
|
944
944
|
if (activeInApp?.id === preview.id) return true;
|
|
@@ -950,12 +950,12 @@ export function EngagePromptProvider({
|
|
|
950
950
|
// [T1] One-shot: already DISPLAYED on this device (persisted across restarts) —
|
|
951
951
|
// never re-show, even if the backend briefly re-serves a not-yet-ACKed row.
|
|
952
952
|
if (seenTestsRef.current?.has(runId)) {
|
|
953
|
-
logger.debug(`[Engage] test ${runId} already displayed on device — skip`);
|
|
953
|
+
__DEV__ && logger.debug(`[Engage] test ${runId} already displayed on device — skip`);
|
|
954
954
|
return false;
|
|
955
955
|
}
|
|
956
956
|
activeInAppVariantRef.current = null;
|
|
957
957
|
setActiveInApp(preview);
|
|
958
|
-
logger.debug(`[Engage] test ${runId} render started`);
|
|
958
|
+
__DEV__ && logger.debug(`[Engage] test ${runId} render started`);
|
|
959
959
|
return true;
|
|
960
960
|
},
|
|
961
961
|
[active, activeInApp],
|
|
@@ -968,7 +968,7 @@ export function EngagePromptProvider({
|
|
|
968
968
|
// PRECEDENCE: a campaign prompt on screen wins — never stack an in-app
|
|
969
969
|
// message over an open survey/NPS/rating prompt.
|
|
970
970
|
if (active !== null) {
|
|
971
|
-
logger.debug('[Engage] campaign prompt active — in-app message deferred');
|
|
971
|
+
__DEV__ && logger.debug('[Engage] campaign prompt active — in-app message deferred');
|
|
972
972
|
return false;
|
|
973
973
|
}
|
|
974
974
|
try {
|
|
@@ -993,7 +993,7 @@ export function EngagePromptProvider({
|
|
|
993
993
|
action: options?.action,
|
|
994
994
|
});
|
|
995
995
|
if (!message) {
|
|
996
|
-
logger.debug('[Engage] no eligible in-app message to render');
|
|
996
|
+
__DEV__ && logger.debug('[Engage] no eligible in-app message to render');
|
|
997
997
|
return false;
|
|
998
998
|
}
|
|
999
999
|
|
|
@@ -1055,7 +1055,7 @@ export function EngagePromptProvider({
|
|
|
1055
1055
|
// apps to see it. Only runs when the host opts in via `previewPollMs` (unset in prod).
|
|
1056
1056
|
useEffect(() => {
|
|
1057
1057
|
if (!previewPollMs || previewPollMs <= 0) return;
|
|
1058
|
-
logger.debug(`[Engage] test-preview warm poll every ${previewPollMs}ms (dev)`);
|
|
1058
|
+
__DEV__ && logger.debug(`[Engage] test-preview warm poll every ${previewPollMs}ms (dev)`);
|
|
1059
1059
|
const interval = setInterval(() => {
|
|
1060
1060
|
void checkForPreview();
|
|
1061
1061
|
}, previewPollMs);
|
|
@@ -56,7 +56,7 @@ function uuidV4(): string {
|
|
|
56
56
|
}
|
|
57
57
|
|
|
58
58
|
export interface EngageTransportConfig {
|
|
59
|
-
/** Backend API base URL (e.g. https://api.scalebun.com). */
|
|
59
|
+
/** Backend API base URL (e.g. https://api.scalebun.com/api/v1). */
|
|
60
60
|
endpoint: string;
|
|
61
61
|
/** SaaS multi-tenant client key — gates upload lanes + x-scalebun-client-key header. */
|
|
62
62
|
clientKey?: string;
|
|
@@ -478,7 +478,7 @@ export class EngageTransport {
|
|
|
478
478
|
schemaVersion: ENGAGE_SCHEMA_VERSION,
|
|
479
479
|
responses: batch,
|
|
480
480
|
});
|
|
481
|
-
logger.debug(`[Engage] flushed ${batch.length} response(s)`);
|
|
481
|
+
__DEV__ && logger.debug(`[Engage] flushed ${batch.length} response(s)`);
|
|
482
482
|
} catch (err) {
|
|
483
483
|
if (EngageTransport._shouldRequeue(err)) this.pendingResponses.unshift(...batch);
|
|
484
484
|
else logger.warn(`[Engage] dropped ${batch.length} response(s) — rejected by server`);
|
|
@@ -504,7 +504,7 @@ export class EngageTransport {
|
|
|
504
504
|
schemaVersion: ENGAGE_SCHEMA_VERSION,
|
|
505
505
|
events: batch,
|
|
506
506
|
});
|
|
507
|
-
logger.debug(`[Engage] flushed ${batch.length} event(s)`);
|
|
507
|
+
__DEV__ && logger.debug(`[Engage] flushed ${batch.length} event(s)`);
|
|
508
508
|
} catch (err) {
|
|
509
509
|
if (EngageTransport._shouldRequeue(err)) this.pendingEvents.unshift(...batch);
|
|
510
510
|
else logger.warn(`[Engage] dropped ${batch.length} in-app event(s) — rejected by server`);
|
|
@@ -519,7 +519,7 @@ export class EngageTransport {
|
|
|
519
519
|
schemaVersion: ENGAGE_SCHEMA_VERSION,
|
|
520
520
|
events: batch,
|
|
521
521
|
});
|
|
522
|
-
logger.debug(`[Engage] flushed ${batch.length} rating-event(s)`);
|
|
522
|
+
__DEV__ && logger.debug(`[Engage] flushed ${batch.length} rating-event(s)`);
|
|
523
523
|
} catch (err) {
|
|
524
524
|
if (EngageTransport._shouldRequeue(err)) this.pendingRatingEvents.unshift(...batch);
|
|
525
525
|
else logger.warn(`[Engage] dropped ${batch.length} rating-event(s) — rejected by server`);
|
|
@@ -534,7 +534,7 @@ export class EngageTransport {
|
|
|
534
534
|
schemaVersion: ENGAGE_SCHEMA_VERSION,
|
|
535
535
|
impressions: batch,
|
|
536
536
|
});
|
|
537
|
-
logger.debug(`[Engage] flushed ${batch.length} survey impression(s)`);
|
|
537
|
+
__DEV__ && logger.debug(`[Engage] flushed ${batch.length} survey impression(s)`);
|
|
538
538
|
} catch (err) {
|
|
539
539
|
if (EngageTransport._shouldRequeue(err)) this.pendingSurveyImpressions.unshift(...batch);
|
|
540
540
|
else logger.warn(`[Engage] dropped ${batch.length} survey impression(s) — rejected by server`);
|
|
@@ -549,7 +549,7 @@ export class EngageTransport {
|
|
|
549
549
|
if (!registration) return;
|
|
550
550
|
try {
|
|
551
551
|
await this._post(ENDPOINTS.ENGAGE_DEVICE_TOKEN, registration);
|
|
552
|
-
logger.debug(`[Engage] registered device token (${registration.platform})`);
|
|
552
|
+
__DEV__ && logger.debug(`[Engage] registered device token (${registration.platform})`);
|
|
553
553
|
} catch (err) {
|
|
554
554
|
if (EngageTransport._shouldRequeue(err)) this.pendingTokens.unshift(registration);
|
|
555
555
|
else logger.warn('[Engage] dropped a device-token registration — rejected by server');
|