posthog-react-native 4.80.0 → 4.81.1

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.
@@ -1,2 +1,2 @@
1
- "use strict";var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.buildFatalExceptionPayload=void 0;var _toConsumableArray2=_interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));var _typeof2=_interopRequireDefault(require("@babel/runtime/helpers/typeof"));var FATAL_PAYLOAD_MAX_BYTES=64*1024;var MAX_PROPERTIES_BYTES=8*1024;var MAX_EXCEPTION_LIST_BYTES=44*1024;var MAX_EXCEPTION_STEPS_BYTES=8*1024;var MAX_EXCEPTION_LIST_ITEMS=32;var MAX_EXCEPTION_STEPS_ITEMS=64;var MAX_JSON_DEPTH=20;var STRING_LIMITS={timestamp:128,distinctId:1024,exceptionLevel:64};var utf8ByteLength=function utf8ByteLength(value){var bytes=0;for(var index=0;index<value.length;index++){var code=value.charCodeAt(index);if(code<=0x7f){bytes+=1;}else if(code<=0x7ff){bytes+=2;}else if(code>=0xd800&&code<=0xdbff&&index+1<value.length){var next=value.charCodeAt(index+1);if(next>=0xdc00&&next<=0xdfff){bytes+=4;index+=1;}else{bytes+=3;}}else{bytes+=3;}}return bytes;};var safeJson=function safeJson(value){try{var result=JSON.stringify(value);return typeof result==='string'?result:null;}catch(_a){return null;}};var jsonBytes=function jsonBytes(value){var serialized=safeJson(value);return serialized===null?Number.MAX_SAFE_INTEGER:utf8ByteLength(serialized);};var isRecord=function isRecord(value){return value!==null&&(0,_typeof2["default"])(value)==='object'&&!Array.isArray(value);};var _isJsonValue=function isJsonValue(value){var depth=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;var ancestors=arguments.length>2&&arguments[2]!==undefined?arguments[2]:[];if(value===null||typeof value==='string'||typeof value==='boolean'){return true;}if(typeof value==='number'){return Number.isFinite(value);}if(depth>=MAX_JSON_DEPTH||(0,_typeof2["default"])(value)!=='object'){return false;}if(ancestors.includes(value)){return false;}var nextAncestors=[].concat((0,_toConsumableArray2["default"])(ancestors),[value]);if(Array.isArray(value)){return value.every(function(item){return _isJsonValue(item,depth+1,nextAncestors);});}return Object.keys(value).every(function(key){return _isJsonValue(value[key],depth+1,nextAncestors);});};var boundedString=function boundedString(value,maxJsonBytes){var bytes=2;var end=0;for(var index=0;index<value.length;index++){var code=value.charCodeAt(index);var nextBytes=void 0;var codeUnits=1;if(code===0x22||code===0x5c||code===0x08||code===0x09||code===0x0a||code===0x0c||code===0x0d){nextBytes=2;}else if(code<=0x1f){nextBytes=6;}else if(code<=0x7f){nextBytes=1;}else if(code<=0x7ff){nextBytes=2;}else if(code>=0xd800&&code<=0xdbff){var low=value.charCodeAt(index+1);if(low>=0xdc00&&low<=0xdfff){nextBytes=4;codeUnits=2;}else{nextBytes=6;}}else if(code>=0xdc00&&code<=0xdfff){nextBytes=6;}else{nextBytes=3;}if(bytes+nextBytes>maxJsonBytes){break;}bytes+=nextBytes;end=index+codeUnits;index+=codeUnits-1;}return end===value.length?value:value.slice(0,end);};var boundedObject=function boundedObject(input,maxBytes){var output={};for(var _i=0,_Object$keys=Object.keys(input);_i<_Object$keys.length;_i++){var key=_Object$keys[_i];var value=input[key];if(!_isJsonValue(value)){continue;}if(typeof value==='string'){var valueBudget=maxBytes-jsonBytes(output)-jsonBytes(key)-1-(Object.keys(output).length===0?0:1);var bounded=boundedString(value,valueBudget);if(bounded.length>0||value.length===0){output[key]=bounded;}continue;}output[key]=value;if(jsonBytes(output)>maxBytes){delete output[key];}}return output;};var boundedObjectArray=function boundedObjectArray(input,maxItems,maxBytes){var output=[];var usedBytes=2;for(var index=0;index<input.length&&output.length<maxItems;index++){var commaBytes=output.length===0?0:1;var remaining=maxBytes-usedBytes-commaBytes;if(remaining<2){break;}var item=boundedObject(input[index],remaining);var itemBytes=jsonBytes(item);if(itemBytes>remaining){break;}output.push(item);usedBytes+=commaBytes+itemBytes;}return output;};var asObjectArray=function asObjectArray(value,name){if(!Array.isArray(value)||value.length===0||!value.every(isRecord)){throw new Error("buildFatalExceptionPayload: ".concat(name," must be a non-empty array of objects"));}return value;};var EXCEPTION_KEYS=new Set(['$exception_list','$exception_steps']);var PRIORITY_KEYS=['$session_id','$device_id','$process_person_profile','$is_identified','$geoip_disable','$app_version','$app_build','$lib','$lib_version','$app_state','$expo_update_id','$expo_runtime_version','$expo_channel','$expo_is_embedded_launch'];var PRIORITY_KEY_SET=new Set(PRIORITY_KEYS);var byPriority=function byPriority(input){var ordered={};for(var _i2=0,_PRIORITY_KEYS=PRIORITY_KEYS;_i2<_PRIORITY_KEYS.length;_i2++){var key=_PRIORITY_KEYS[_i2];if(Object.prototype.hasOwnProperty.call(input,key)){ordered[key]=input[key];}}for(var _i3=0,_Object$keys2=Object.keys(input);_i3<_Object$keys2.length;_i3++){var _key=_Object$keys2[_i3];if(!PRIORITY_KEY_SET.has(_key)){ordered[_key]=input[_key];}}return ordered;};var buildFatalExceptionPayload=exports.buildFatalExceptionPayload=function buildFatalExceptionPayload(input){if(!input.timestamp){throw new Error('buildFatalExceptionPayload: timestamp is required');}var source=isRecord(input.properties)?input.properties:{};var exceptionList=boundedObjectArray(asObjectArray(source.$exception_list,'$exception_list'),MAX_EXCEPTION_LIST_ITEMS,MAX_EXCEPTION_LIST_BYTES);if(exceptionList.length===0){throw new Error('buildFatalExceptionPayload: $exception_list could not be serialized');}var rest={};for(var _i4=0,_Object$keys3=Object.keys(source);_i4<_Object$keys3.length;_i4++){var key=_Object$keys3[_i4];if(!EXCEPTION_KEYS.has(key)){rest[key]=source[key];}}var properties=boundedObject(byPriority(rest),MAX_PROPERTIES_BYTES);properties.$exception_list=exceptionList;properties.$exception_level=boundedString(typeof source.$exception_level==='string'&&source.$exception_level?source.$exception_level:'fatal',STRING_LIMITS.exceptionLevel);if(Array.isArray(source.$exception_steps)){var steps=boundedObjectArray(source.$exception_steps.filter(isRecord),MAX_EXCEPTION_STEPS_ITEMS,MAX_EXCEPTION_STEPS_BYTES);if(steps.length>0){properties.$exception_steps=steps;}}var payload={distinctId:boundedString(input.distinctId||'',STRING_LIMITS.distinctId),timestamp:boundedString(input.timestamp,STRING_LIMITS.timestamp),properties:properties};if(jsonBytes(payload)>FATAL_PAYLOAD_MAX_BYTES){throw new Error('buildFatalExceptionPayload: serialized payload exceeds 64 KiB');}return payload;};
1
+ "use strict";var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.buildFatalExceptionPayload=void 0;var _toConsumableArray2=_interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));var _typeof2=_interopRequireDefault(require("@babel/runtime/helpers/typeof"));var FATAL_PAYLOAD_MAX_BYTES=64*1024;var MAX_PROPERTIES_BYTES=8*1024;var MAX_EXCEPTION_LIST_BYTES=44*1024;var MAX_EXCEPTION_STEPS_BYTES=8*1024;var MAX_EXCEPTION_LIST_ITEMS=32;var MAX_EXCEPTION_STEPS_ITEMS=64;var MAX_JSON_DEPTH=20;var STRING_LIMITS={timestamp:128,distinctId:1024,exceptionLevel:64};var utf8ByteLength=function utf8ByteLength(value){var bytes=0;for(var index=0;index<value.length;index++){var code=value.charCodeAt(index);if(code<=0x7f){bytes+=1;}else if(code<=0x7ff){bytes+=2;}else if(code>=0xd800&&code<=0xdbff&&index+1<value.length){var next=value.charCodeAt(index+1);if(next>=0xdc00&&next<=0xdfff){bytes+=4;index+=1;}else{bytes+=3;}}else{bytes+=3;}}return bytes;};var safeJson=function safeJson(value){try{var result=JSON.stringify(value);return typeof result==='string'?result:null;}catch(_a){return null;}};var jsonBytes=function jsonBytes(value){var serialized=safeJson(value);return serialized===null?Number.MAX_SAFE_INTEGER:utf8ByteLength(serialized);};var isRecord=function isRecord(value){return value!==null&&(0,_typeof2["default"])(value)==='object'&&!Array.isArray(value);};var _isJsonValue=function isJsonValue(value){var depth=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;var ancestors=arguments.length>2&&arguments[2]!==undefined?arguments[2]:[];if(value===null||typeof value==='string'||typeof value==='boolean'){return true;}if(typeof value==='number'){return Number.isFinite(value);}if(depth>=MAX_JSON_DEPTH||(0,_typeof2["default"])(value)!=='object'){return false;}if(ancestors.includes(value)){return false;}var nextAncestors=[].concat((0,_toConsumableArray2["default"])(ancestors),[value]);if(Array.isArray(value)){return value.every(function(item){return _isJsonValue(item,depth+1,nextAncestors);});}return Object.keys(value).every(function(key){var item=value[key];return item===undefined||_isJsonValue(item,depth+1,nextAncestors);});};var boundedString=function boundedString(value,maxJsonBytes){var bytes=2;var end=0;for(var index=0;index<value.length;index++){var code=value.charCodeAt(index);var nextBytes=void 0;var codeUnits=1;if(code===0x22||code===0x5c||code===0x08||code===0x09||code===0x0a||code===0x0c||code===0x0d){nextBytes=2;}else if(code<=0x1f){nextBytes=6;}else if(code<=0x7f){nextBytes=1;}else if(code<=0x7ff){nextBytes=2;}else if(code>=0xd800&&code<=0xdbff){var low=value.charCodeAt(index+1);if(low>=0xdc00&&low<=0xdfff){nextBytes=4;codeUnits=2;}else{nextBytes=6;}}else if(code>=0xdc00&&code<=0xdfff){nextBytes=6;}else{nextBytes=3;}if(bytes+nextBytes>maxJsonBytes){break;}bytes+=nextBytes;end=index+codeUnits;index+=codeUnits-1;}return end===value.length?value:value.slice(0,end);};var boundedObject=function boundedObject(input,maxBytes){var output={};for(var _i=0,_Object$keys=Object.keys(input);_i<_Object$keys.length;_i++){var key=_Object$keys[_i];var value=input[key];if(!_isJsonValue(value)){continue;}if(typeof value==='string'){var valueBudget=maxBytes-jsonBytes(output)-jsonBytes(key)-1-(Object.keys(output).length===0?0:1);var bounded=boundedString(value,valueBudget);if(bounded.length>0||value.length===0){output[key]=bounded;}continue;}output[key]=value;if(jsonBytes(output)>maxBytes){delete output[key];}}return output;};var boundedObjectArray=function boundedObjectArray(input,maxItems,maxBytes){var output=[];var usedBytes=2;for(var index=0;index<input.length&&output.length<maxItems;index++){var commaBytes=output.length===0?0:1;var remaining=maxBytes-usedBytes-commaBytes;if(remaining<2){break;}var item=boundedObject(input[index],remaining);var itemBytes=jsonBytes(item);if(itemBytes>remaining){break;}output.push(item);usedBytes+=commaBytes+itemBytes;}return output;};var asObjectArray=function asObjectArray(value,name){if(!Array.isArray(value)||value.length===0||!value.every(isRecord)){throw new Error("buildFatalExceptionPayload: ".concat(name," must be a non-empty array of objects"));}return value;};var EXCEPTION_KEYS=new Set(['$exception_list','$exception_steps']);var PRIORITY_KEYS=['$session_id','$device_id','$process_person_profile','$is_identified','$geoip_disable','$app_version','$app_build','$lib','$lib_version','$app_state','$expo_update_id','$expo_runtime_version','$expo_channel','$expo_is_embedded_launch'];var PRIORITY_KEY_SET=new Set(PRIORITY_KEYS);var byPriority=function byPriority(input){var ordered={};for(var _i2=0,_PRIORITY_KEYS=PRIORITY_KEYS;_i2<_PRIORITY_KEYS.length;_i2++){var key=_PRIORITY_KEYS[_i2];if(Object.prototype.hasOwnProperty.call(input,key)){ordered[key]=input[key];}}for(var _i3=0,_Object$keys2=Object.keys(input);_i3<_Object$keys2.length;_i3++){var _key=_Object$keys2[_i3];if(!PRIORITY_KEY_SET.has(_key)){ordered[_key]=input[_key];}}return ordered;};var buildFatalExceptionPayload=exports.buildFatalExceptionPayload=function buildFatalExceptionPayload(input){if(!input.timestamp){throw new Error('buildFatalExceptionPayload: timestamp is required');}var source=isRecord(input.properties)?input.properties:{};var exceptionList=boundedObjectArray(asObjectArray(source.$exception_list,'$exception_list'),MAX_EXCEPTION_LIST_ITEMS,MAX_EXCEPTION_LIST_BYTES);if(exceptionList.length===0){throw new Error('buildFatalExceptionPayload: $exception_list could not be serialized');}var rest={};for(var _i4=0,_Object$keys3=Object.keys(source);_i4<_Object$keys3.length;_i4++){var key=_Object$keys3[_i4];if(!EXCEPTION_KEYS.has(key)){rest[key]=source[key];}}var properties=boundedObject(byPriority(rest),MAX_PROPERTIES_BYTES);properties.$exception_list=exceptionList;properties.$exception_level=boundedString(typeof source.$exception_level==='string'&&source.$exception_level?source.$exception_level:'fatal',STRING_LIMITS.exceptionLevel);if(Array.isArray(source.$exception_steps)){var steps=boundedObjectArray(source.$exception_steps.filter(isRecord),MAX_EXCEPTION_STEPS_ITEMS,MAX_EXCEPTION_STEPS_BYTES);if(steps.length>0){properties.$exception_steps=steps;}}var payload={distinctId:boundedString(input.distinctId||'',STRING_LIMITS.distinctId),timestamp:boundedString(input.timestamp,STRING_LIMITS.timestamp),properties:properties};if(jsonBytes(payload)>FATAL_PAYLOAD_MAX_BYTES){throw new Error('buildFatalExceptionPayload: serialized payload exceeds 64 KiB');}return payload;};
2
2
  //# sourceMappingURL=fatal-payload.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"fatal-payload.js","names":["FATAL_PAYLOAD_MAX_BYTES","MAX_PROPERTIES_BYTES","MAX_EXCEPTION_LIST_BYTES","MAX_EXCEPTION_STEPS_BYTES","MAX_EXCEPTION_LIST_ITEMS","MAX_EXCEPTION_STEPS_ITEMS","MAX_JSON_DEPTH","STRING_LIMITS","timestamp","distinctId","exceptionLevel","utf8ByteLength","value","bytes","index","length","code","charCodeAt","next","safeJson","result","JSON","stringify","jsonBytes","serialized","Number","MAX_SAFE_INTEGER","isRecord","_typeof2","Array","isArray","isJsonValue","depth","arguments","undefined","ancestors","isFinite","includes","nextAncestors","concat","_toConsumableArray2","every","item","Object","keys","key","boundedString","maxJsonBytes","end","nextBytes","codeUnits","low","slice","boundedObject","input","maxBytes","output","_i","_Object$keys","valueBudget","bounded","boundedObjectArray","maxItems","usedBytes","commaBytes","remaining","itemBytes","push","asObjectArray","name","Error","EXCEPTION_KEYS","Set","PRIORITY_KEYS","PRIORITY_KEY_SET","byPriority","ordered","_i2","_PRIORITY_KEYS","prototype","hasOwnProperty","call","_i3","_Object$keys2","has","buildFatalExceptionPayload","exports","source","properties","exceptionList","$exception_list","rest","_i4","_Object$keys3","$exception_level","$exception_steps","steps","filter","payload"],"sources":["../../src/error-tracking/fatal-payload.ts"],"sourcesContent":["import { JsonType, PostHogEventProperties } from '@posthog/core'\n\n// The payload handed to the native SDK on the fatal path. Native captures it as a\n// `$exception` event with `$exception_level: 'fatal'`, which both native SDKs persist to\n// disk synchronously before the call returns — that synchronous write is the durability\n// this path exists for, so the payload has to stay small and strictly JSON-safe.\n//\n// Crash-time attribution needs no special handling here: native captures inside the dying\n// process, so its own static context (app version, OS, device) is already the crash-time\n// context. Only properties native cannot know — the JS exception itself, `$app_state`, the\n// Expo update context — travel in this payload.\nconst FATAL_PAYLOAD_MAX_BYTES = 64 * 1024\n// 8 + 44 + 8 KiB of content, leaving ~4 KiB of the 64 KiB cap for keys and structure.\nconst MAX_PROPERTIES_BYTES = 8 * 1024\nconst MAX_EXCEPTION_LIST_BYTES = 44 * 1024\nconst MAX_EXCEPTION_STEPS_BYTES = 8 * 1024\nconst MAX_EXCEPTION_LIST_ITEMS = 32\nconst MAX_EXCEPTION_STEPS_ITEMS = 64\nconst MAX_JSON_DEPTH = 20\n\nconst STRING_LIMITS = {\n timestamp: 128,\n distinctId: 1024,\n exceptionLevel: 64,\n} as const\n\nconst utf8ByteLength = (value: string): number => {\n let bytes = 0\n for (let index = 0; index < value.length; index++) {\n const code = value.charCodeAt(index)\n if (code <= 0x7f) {\n bytes += 1\n } else if (code <= 0x7ff) {\n bytes += 2\n } else if (code >= 0xd800 && code <= 0xdbff && index + 1 < value.length) {\n const next = value.charCodeAt(index + 1)\n if (next >= 0xdc00 && next <= 0xdfff) {\n bytes += 4\n index += 1\n } else {\n bytes += 3\n }\n } else {\n bytes += 3\n }\n }\n return bytes\n}\n\nconst safeJson = (value: unknown): string | null => {\n try {\n const result = JSON.stringify(value)\n return typeof result === 'string' ? result : null\n } catch {\n return null\n }\n}\n\nconst jsonBytes = (value: unknown): number => {\n const serialized = safeJson(value)\n return serialized === null ? Number.MAX_SAFE_INTEGER : utf8ByteLength(serialized)\n}\n\nconst isRecord = (value: unknown): value is Record<string, unknown> =>\n value !== null && typeof value === 'object' && !Array.isArray(value)\n\nconst isJsonValue = (value: unknown, depth = 0, ancestors: unknown[] = []): value is JsonType => {\n if (value === null || typeof value === 'string' || typeof value === 'boolean') {\n return true\n }\n if (typeof value === 'number') {\n return Number.isFinite(value)\n }\n if (depth >= MAX_JSON_DEPTH || typeof value !== 'object') {\n return false\n }\n if (ancestors.includes(value)) {\n return false\n }\n const nextAncestors = [...ancestors, value]\n if (Array.isArray(value)) {\n return value.every((item) => isJsonValue(item, depth + 1, nextAncestors))\n }\n return Object.keys(value as Record<string, unknown>).every((key) =>\n isJsonValue((value as Record<string, unknown>)[key], depth + 1, nextAncestors)\n )\n}\n\n// Return the longest prefix whose JSON string representation fits. Measure as we scan instead\n// of serializing the whole value: fatal-path values can be very large, and JSON escaping means\n// a JavaScript string's length is not its serialized UTF-8 size.\nconst boundedString = (value: string, maxJsonBytes: number): string => {\n let bytes = 2 // surrounding quotes\n let end = 0\n for (let index = 0; index < value.length; index++) {\n const code = value.charCodeAt(index)\n let nextBytes: number\n let codeUnits = 1\n if (\n code === 0x22 ||\n code === 0x5c ||\n code === 0x08 ||\n code === 0x09 ||\n code === 0x0a ||\n code === 0x0c ||\n code === 0x0d\n ) {\n nextBytes = 2\n } else if (code <= 0x1f) {\n nextBytes = 6\n } else if (code <= 0x7f) {\n nextBytes = 1\n } else if (code <= 0x7ff) {\n nextBytes = 2\n } else if (code >= 0xd800 && code <= 0xdbff) {\n const low = value.charCodeAt(index + 1)\n if (low >= 0xdc00 && low <= 0xdfff) {\n nextBytes = 4\n codeUnits = 2\n } else {\n nextBytes = 6 // JSON.stringify escapes lone surrogates\n }\n } else if (code >= 0xdc00 && code <= 0xdfff) {\n nextBytes = 6\n } else {\n nextBytes = 3\n }\n if (bytes + nextBytes > maxJsonBytes) {\n break\n }\n bytes += nextBytes\n end = index + codeUnits\n index += codeUnits - 1\n }\n return end === value.length ? value : value.slice(0, end)\n}\n\n// Values are retained by reference when they fit. This avoids cloning arbitrary customer data\n// on the fatal path. Only an oversized string is copied, as a bounded prefix.\nconst boundedObject = (input: Record<string, unknown>, maxBytes: number): { [key: string]: JsonType } => {\n const output: { [key: string]: JsonType } = {}\n for (const key of Object.keys(input)) {\n const value = input[key]\n if (!isJsonValue(value)) {\n continue\n }\n if (typeof value === 'string') {\n // Work out how much of this string can fit in the object, including its key and commas,\n // without first creating a serialized copy of the potentially unbounded input.\n const valueBudget = maxBytes - jsonBytes(output) - jsonBytes(key) - 1 - (Object.keys(output).length === 0 ? 0 : 1)\n const bounded = boundedString(value, valueBudget)\n if (bounded.length > 0 || value.length === 0) {\n output[key] = bounded\n }\n continue\n }\n output[key] = value\n if (jsonBytes(output) > maxBytes) {\n delete output[key]\n }\n }\n return output\n}\n\nconst boundedObjectArray = (\n input: ReadonlyArray<Record<string, unknown>>,\n maxItems: number,\n maxBytes: number\n): Array<{ [key: string]: JsonType }> => {\n const output: Array<{ [key: string]: JsonType }> = []\n let usedBytes = 2 // []\n for (let index = 0; index < input.length && output.length < maxItems; index++) {\n const commaBytes = output.length === 0 ? 0 : 1\n const remaining = maxBytes - usedBytes - commaBytes\n if (remaining < 2) {\n break\n }\n const item = boundedObject(input[index], remaining)\n const itemBytes = jsonBytes(item)\n if (itemBytes > remaining) {\n break\n }\n output.push(item)\n usedBytes += commaBytes + itemBytes\n }\n return output\n}\n\nconst asObjectArray = (value: unknown, name: string): Array<Record<string, unknown>> => {\n if (!Array.isArray(value) || value.length === 0 || !value.every(isRecord)) {\n throw new Error(`buildFatalExceptionPayload: ${name} must be a non-empty array of objects`)\n }\n return value\n}\n\nexport interface FatalExceptionPayload {\n distinctId: string\n timestamp: string\n properties: { [key: string]: JsonType }\n}\n\nexport interface BuildFatalExceptionPayloadInput {\n timestamp: string\n distinctId: string\n // The full property bag of the `before_send`-accepted event. Everything native cannot\n // reconstruct itself is carried through; conflicting keys are native's to resolve.\n properties: PostHogEventProperties\n}\n\n// `$exception_list` and `$exception_steps` get their own budgets: they are the unbounded,\n// customer-influenced parts of the payload, and one must not be able to crowd out the rest.\nconst EXCEPTION_KEYS = new Set(['$exception_list', '$exception_steps'])\n\n// The remaining properties are bounded as one bag, and `boundedObject` fills in key order\n// until the budget runs out. An app with a large flag set therefore pushes whatever sorts\n// after `$feature/*` off the end — session linkage and release attribution included. These\n// keys are written first so a big property bag can only cost bulk properties, never the\n// attribution a crash report is useless without.\nconst PRIORITY_KEYS = [\n '$session_id',\n '$device_id',\n // Consent and identity resolution: native cannot re-derive what JS decided.\n '$process_person_profile',\n '$is_identified',\n '$geoip_disable',\n // Release attribution — what a crash gets triaged by.\n '$app_version',\n '$app_build',\n '$lib',\n '$lib_version',\n // Crash-time context native has no view of.\n '$app_state',\n '$expo_update_id',\n '$expo_runtime_version',\n '$expo_channel',\n '$expo_is_embedded_launch',\n] as const\nconst PRIORITY_KEY_SET = new Set<string>(PRIORITY_KEYS)\n\n// Priority keys first, then everything else in its original order.\nconst byPriority = (input: Record<string, unknown>): Record<string, unknown> => {\n const ordered: Record<string, unknown> = {}\n for (const key of PRIORITY_KEYS) {\n if (Object.prototype.hasOwnProperty.call(input, key)) {\n ordered[key] = input[key]\n }\n }\n for (const key of Object.keys(input)) {\n if (!PRIORITY_KEY_SET.has(key)) {\n ordered[key] = input[key]\n }\n }\n return ordered\n}\n\nexport const buildFatalExceptionPayload = (input: BuildFatalExceptionPayloadInput): FatalExceptionPayload => {\n if (!input.timestamp) {\n throw new Error('buildFatalExceptionPayload: timestamp is required')\n }\n\n const source = isRecord(input.properties) ? input.properties : {}\n const exceptionList = boundedObjectArray(\n asObjectArray(source.$exception_list, '$exception_list'),\n MAX_EXCEPTION_LIST_ITEMS,\n MAX_EXCEPTION_LIST_BYTES\n )\n if (exceptionList.length === 0) {\n throw new Error('buildFatalExceptionPayload: $exception_list could not be serialized')\n }\n\n const rest: Record<string, unknown> = {}\n for (const key of Object.keys(source)) {\n if (!EXCEPTION_KEYS.has(key)) {\n rest[key] = source[key]\n }\n }\n\n const properties: { [key: string]: JsonType } = boundedObject(byPriority(rest), MAX_PROPERTIES_BYTES)\n properties.$exception_list = exceptionList\n // Native's fatal fast path keys off this exact value; without it the record is queued\n // asynchronously and the process can die before it reaches disk.\n properties.$exception_level = boundedString(\n typeof source.$exception_level === 'string' && source.$exception_level ? source.$exception_level : 'fatal',\n STRING_LIMITS.exceptionLevel\n )\n\n if (Array.isArray(source.$exception_steps)) {\n const steps = boundedObjectArray(\n (source.$exception_steps as unknown[]).filter(isRecord),\n MAX_EXCEPTION_STEPS_ITEMS,\n MAX_EXCEPTION_STEPS_BYTES\n )\n if (steps.length > 0) {\n properties.$exception_steps = steps\n }\n }\n\n const payload: FatalExceptionPayload = {\n distinctId: boundedString(input.distinctId || '', STRING_LIMITS.distinctId),\n timestamp: boundedString(input.timestamp, STRING_LIMITS.timestamp),\n properties,\n }\n\n // The per-field budgets leave headroom for keys and fixed metadata. Keep the total check\n // anyway: it is the invariant the native bridge relies on.\n if (jsonBytes(payload) > FATAL_PAYLOAD_MAX_BYTES) {\n throw new Error('buildFatalExceptionPayload: serialized payload exceeds 64 KiB')\n }\n return payload\n}\n"],"mappings":"qXAWA,GAAM,CAAAA,uBAAuB,CAAG,EAAE,CAAG,IAAI,CAEzC,GAAM,CAAAC,oBAAoB,CAAG,CAAC,CAAG,IAAI,CACrC,GAAM,CAAAC,wBAAwB,CAAG,EAAE,CAAG,IAAI,CAC1C,GAAM,CAAAC,yBAAyB,CAAG,CAAC,CAAG,IAAI,CAC1C,GAAM,CAAAC,wBAAwB,CAAG,EAAE,CACnC,GAAM,CAAAC,yBAAyB,CAAG,EAAE,CACpC,GAAM,CAAAC,cAAc,CAAG,EAAE,CAEzB,GAAM,CAAAC,aAAa,CAAG,CACpBC,SAAS,CAAE,GAAG,CACdC,UAAU,CAAE,IAAI,CAChBC,cAAc,CAAE,E,CACR,CAEV,GAAM,CAAAC,cAAc,CAAG,QAAjB,CAAAA,cAAcA,CAAIC,KAAa,CAAY,CAC/C,GAAI,CAAAC,KAAK,CAAG,CAAC,CACb,IAAK,GAAI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CAClF,CACA,MAAO,CAAA4B,OAAO,CAChB,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"fatal-payload.js","names":["FATAL_PAYLOAD_MAX_BYTES","MAX_PROPERTIES_BYTES","MAX_EXCEPTION_LIST_BYTES","MAX_EXCEPTION_STEPS_BYTES","MAX_EXCEPTION_LIST_ITEMS","MAX_EXCEPTION_STEPS_ITEMS","MAX_JSON_DEPTH","STRING_LIMITS","timestamp","distinctId","exceptionLevel","utf8ByteLength","value","bytes","index","length","code","charCodeAt","next","safeJson","result","JSON","stringify","jsonBytes","serialized","Number","MAX_SAFE_INTEGER","isRecord","_typeof2","Array","isArray","isJsonValue","depth","arguments","undefined","ancestors","isFinite","includes","nextAncestors","concat","_toConsumableArray2","every","item","Object","keys","key","boundedString","maxJsonBytes","end","nextBytes","codeUnits","low","slice","boundedObject","input","maxBytes","output","_i","_Object$keys","valueBudget","bounded","boundedObjectArray","maxItems","usedBytes","commaBytes","remaining","itemBytes","push","asObjectArray","name","Error","EXCEPTION_KEYS","Set","PRIORITY_KEYS","PRIORITY_KEY_SET","byPriority","ordered","_i2","_PRIORITY_KEYS","prototype","hasOwnProperty","call","_i3","_Object$keys2","has","buildFatalExceptionPayload","exports","source","properties","exceptionList","$exception_list","rest","_i4","_Object$keys3","$exception_level","$exception_steps","steps","filter","payload"],"sources":["../../src/error-tracking/fatal-payload.ts"],"sourcesContent":["import { JsonType, PostHogEventProperties } from '@posthog/core'\n\n// The payload handed to the native SDK on the fatal path. Native captures it as a\n// `$exception` event with `$exception_level: 'fatal'`, which both native SDKs persist to\n// disk synchronously before the call returns — that synchronous write is the durability\n// this path exists for, so the payload has to stay small and strictly JSON-safe.\n//\n// Crash-time attribution needs no special handling here: native captures inside the dying\n// process, so its own static context (app version, OS, device) is already the crash-time\n// context. Only properties native cannot know — the JS exception itself, `$app_state`, the\n// Expo update context — travel in this payload.\nconst FATAL_PAYLOAD_MAX_BYTES = 64 * 1024\n// 8 + 44 + 8 KiB of content, leaving ~4 KiB of the 64 KiB cap for keys and structure.\nconst MAX_PROPERTIES_BYTES = 8 * 1024\nconst MAX_EXCEPTION_LIST_BYTES = 44 * 1024\nconst MAX_EXCEPTION_STEPS_BYTES = 8 * 1024\nconst MAX_EXCEPTION_LIST_ITEMS = 32\nconst MAX_EXCEPTION_STEPS_ITEMS = 64\nconst MAX_JSON_DEPTH = 20\n\nconst STRING_LIMITS = {\n timestamp: 128,\n distinctId: 1024,\n exceptionLevel: 64,\n} as const\n\nconst utf8ByteLength = (value: string): number => {\n let bytes = 0\n for (let index = 0; index < value.length; index++) {\n const code = value.charCodeAt(index)\n if (code <= 0x7f) {\n bytes += 1\n } else if (code <= 0x7ff) {\n bytes += 2\n } else if (code >= 0xd800 && code <= 0xdbff && index + 1 < value.length) {\n const next = value.charCodeAt(index + 1)\n if (next >= 0xdc00 && next <= 0xdfff) {\n bytes += 4\n index += 1\n } else {\n bytes += 3\n }\n } else {\n bytes += 3\n }\n }\n return bytes\n}\n\nconst safeJson = (value: unknown): string | null => {\n try {\n const result = JSON.stringify(value)\n return typeof result === 'string' ? result : null\n } catch {\n return null\n }\n}\n\nconst jsonBytes = (value: unknown): number => {\n const serialized = safeJson(value)\n return serialized === null ? Number.MAX_SAFE_INTEGER : utf8ByteLength(serialized)\n}\n\nconst isRecord = (value: unknown): value is Record<string, unknown> =>\n value !== null && typeof value === 'object' && !Array.isArray(value)\n\nconst isJsonValue = (value: unknown, depth = 0, ancestors: unknown[] = []): value is JsonType => {\n if (value === null || typeof value === 'string' || typeof value === 'boolean') {\n return true\n }\n if (typeof value === 'number') {\n return Number.isFinite(value)\n }\n if (depth >= MAX_JSON_DEPTH || typeof value !== 'object') {\n return false\n }\n if (ancestors.includes(value)) {\n return false\n }\n const nextAncestors = [...ancestors, value]\n if (Array.isArray(value)) {\n return value.every((item) => isJsonValue(item, depth + 1, nextAncestors))\n }\n return Object.keys(value as Record<string, unknown>).every((key) => {\n const item = (value as Record<string, unknown>)[key]\n // `JSON.stringify` omits object properties whose value is `undefined`, so one does not\n // make the object unserializable. Treat it the same way: the key is dropped when the\n // payload is serialized rather than failing the whole object. Without this, a single\n // `undefined` deep in a value (for example `chunk_id` on a stack frame that is not in\n // the chunk-id map) makes `boundedObject` skip the entire key it sits under.\n return item === undefined || isJsonValue(item, depth + 1, nextAncestors)\n })\n}\n\n// Return the longest prefix whose JSON string representation fits. Measure as we scan instead\n// of serializing the whole value: fatal-path values can be very large, and JSON escaping means\n// a JavaScript string's length is not its serialized UTF-8 size.\nconst boundedString = (value: string, maxJsonBytes: number): string => {\n let bytes = 2 // surrounding quotes\n let end = 0\n for (let index = 0; index < value.length; index++) {\n const code = value.charCodeAt(index)\n let nextBytes: number\n let codeUnits = 1\n if (\n code === 0x22 ||\n code === 0x5c ||\n code === 0x08 ||\n code === 0x09 ||\n code === 0x0a ||\n code === 0x0c ||\n code === 0x0d\n ) {\n nextBytes = 2\n } else if (code <= 0x1f) {\n nextBytes = 6\n } else if (code <= 0x7f) {\n nextBytes = 1\n } else if (code <= 0x7ff) {\n nextBytes = 2\n } else if (code >= 0xd800 && code <= 0xdbff) {\n const low = value.charCodeAt(index + 1)\n if (low >= 0xdc00 && low <= 0xdfff) {\n nextBytes = 4\n codeUnits = 2\n } else {\n nextBytes = 6 // JSON.stringify escapes lone surrogates\n }\n } else if (code >= 0xdc00 && code <= 0xdfff) {\n nextBytes = 6\n } else {\n nextBytes = 3\n }\n if (bytes + nextBytes > maxJsonBytes) {\n break\n }\n bytes += nextBytes\n end = index + codeUnits\n index += codeUnits - 1\n }\n return end === value.length ? value : value.slice(0, end)\n}\n\n// Values are retained by reference when they fit. This avoids cloning arbitrary customer data\n// on the fatal path. Only an oversized string is copied, as a bounded prefix.\nconst boundedObject = (input: Record<string, unknown>, maxBytes: number): { [key: string]: JsonType } => {\n const output: { [key: string]: JsonType } = {}\n for (const key of Object.keys(input)) {\n const value = input[key]\n if (!isJsonValue(value)) {\n continue\n }\n if (typeof value === 'string') {\n // Work out how much of this string can fit in the object, including its key and commas,\n // without first creating a serialized copy of the potentially unbounded input.\n const valueBudget = maxBytes - jsonBytes(output) - jsonBytes(key) - 1 - (Object.keys(output).length === 0 ? 0 : 1)\n const bounded = boundedString(value, valueBudget)\n if (bounded.length > 0 || value.length === 0) {\n output[key] = bounded\n }\n continue\n }\n output[key] = value\n if (jsonBytes(output) > maxBytes) {\n delete output[key]\n }\n }\n return output\n}\n\nconst boundedObjectArray = (\n input: ReadonlyArray<Record<string, unknown>>,\n maxItems: number,\n maxBytes: number\n): Array<{ [key: string]: JsonType }> => {\n const output: Array<{ [key: string]: JsonType }> = []\n let usedBytes = 2 // []\n for (let index = 0; index < input.length && output.length < maxItems; index++) {\n const commaBytes = output.length === 0 ? 0 : 1\n const remaining = maxBytes - usedBytes - commaBytes\n if (remaining < 2) {\n break\n }\n const item = boundedObject(input[index], remaining)\n const itemBytes = jsonBytes(item)\n if (itemBytes > remaining) {\n break\n }\n output.push(item)\n usedBytes += commaBytes + itemBytes\n }\n return output\n}\n\nconst asObjectArray = (value: unknown, name: string): Array<Record<string, unknown>> => {\n if (!Array.isArray(value) || value.length === 0 || !value.every(isRecord)) {\n throw new Error(`buildFatalExceptionPayload: ${name} must be a non-empty array of objects`)\n }\n return value\n}\n\nexport interface FatalExceptionPayload {\n distinctId: string\n timestamp: string\n properties: { [key: string]: JsonType }\n}\n\nexport interface BuildFatalExceptionPayloadInput {\n timestamp: string\n distinctId: string\n // The full property bag of the `before_send`-accepted event. Everything native cannot\n // reconstruct itself is carried through; conflicting keys are native's to resolve.\n properties: PostHogEventProperties\n}\n\n// `$exception_list` and `$exception_steps` get their own budgets: they are the unbounded,\n// customer-influenced parts of the payload, and one must not be able to crowd out the rest.\nconst EXCEPTION_KEYS = new Set(['$exception_list', '$exception_steps'])\n\n// The remaining properties are bounded as one bag, and `boundedObject` fills in key order\n// until the budget runs out. An app with a large flag set therefore pushes whatever sorts\n// after `$feature/*` off the end — session linkage and release attribution included. These\n// keys are written first so a big property bag can only cost bulk properties, never the\n// attribution a crash report is useless without.\nconst PRIORITY_KEYS = [\n '$session_id',\n '$device_id',\n // Consent and identity resolution: native cannot re-derive what JS decided.\n '$process_person_profile',\n '$is_identified',\n '$geoip_disable',\n // Release attribution — what a crash gets triaged by.\n '$app_version',\n '$app_build',\n '$lib',\n '$lib_version',\n // Crash-time context native has no view of.\n '$app_state',\n '$expo_update_id',\n '$expo_runtime_version',\n '$expo_channel',\n '$expo_is_embedded_launch',\n] as const\nconst PRIORITY_KEY_SET = new Set<string>(PRIORITY_KEYS)\n\n// Priority keys first, then everything else in its original order.\nconst byPriority = (input: Record<string, unknown>): Record<string, unknown> => {\n const ordered: Record<string, unknown> = {}\n for (const key of PRIORITY_KEYS) {\n if (Object.prototype.hasOwnProperty.call(input, key)) {\n ordered[key] = input[key]\n }\n }\n for (const key of Object.keys(input)) {\n if (!PRIORITY_KEY_SET.has(key)) {\n ordered[key] = input[key]\n }\n }\n return ordered\n}\n\nexport const buildFatalExceptionPayload = (input: BuildFatalExceptionPayloadInput): FatalExceptionPayload => {\n if (!input.timestamp) {\n throw new Error('buildFatalExceptionPayload: timestamp is required')\n }\n\n const source = isRecord(input.properties) ? input.properties : {}\n const exceptionList = boundedObjectArray(\n asObjectArray(source.$exception_list, '$exception_list'),\n MAX_EXCEPTION_LIST_ITEMS,\n MAX_EXCEPTION_LIST_BYTES\n )\n if (exceptionList.length === 0) {\n throw new Error('buildFatalExceptionPayload: $exception_list could not be serialized')\n }\n\n const rest: Record<string, unknown> = {}\n for (const key of Object.keys(source)) {\n if (!EXCEPTION_KEYS.has(key)) {\n rest[key] = source[key]\n }\n }\n\n const properties: { [key: string]: JsonType } = boundedObject(byPriority(rest), MAX_PROPERTIES_BYTES)\n properties.$exception_list = exceptionList\n // Native's fatal fast path keys off this exact value; without it the record is queued\n // asynchronously and the process can die before it reaches disk.\n properties.$exception_level = boundedString(\n typeof source.$exception_level === 'string' && source.$exception_level ? source.$exception_level : 'fatal',\n STRING_LIMITS.exceptionLevel\n )\n\n if (Array.isArray(source.$exception_steps)) {\n const steps = boundedObjectArray(\n (source.$exception_steps as unknown[]).filter(isRecord),\n MAX_EXCEPTION_STEPS_ITEMS,\n MAX_EXCEPTION_STEPS_BYTES\n )\n if (steps.length > 0) {\n properties.$exception_steps = steps\n }\n }\n\n const payload: FatalExceptionPayload = {\n distinctId: boundedString(input.distinctId || '', STRING_LIMITS.distinctId),\n timestamp: boundedString(input.timestamp, STRING_LIMITS.timestamp),\n properties,\n }\n\n // The per-field budgets leave headroom for keys and fixed metadata. Keep the total check\n // anyway: it is the invariant the native bridge relies on.\n if (jsonBytes(payload) > FATAL_PAYLOAD_MAX_BYTES) {\n throw new Error('buildFatalExceptionPayload: serialized payload exceeds 64 KiB')\n }\n return payload\n}\n"],"mappings":"qXAWA,GAAM,CAAAA,uBAAuB,CAAG,EAAE,CAAG,IAAI,CAEzC,GAAM,CAAAC,oBAAoB,CAAG,CAAC,CAAG,IAAI,CACrC,GAAM,CAAAC,wBAAwB,CAAG,EAAE,CAAG,IAAI,CAC1C,GAAM,CAAAC,yBAAyB,CAAG,CAAC,CAAG,IAAI,CAC1C,GAAM,CAAAC,wBAAwB,CAAG,EAAE,CACnC,GAAM,CAAAC,yBAAyB,CAAG,EAAE,CACpC,GAAM,CAAAC,cAAc,CAAG,EAAE,CAEzB,GAAM,CAAAC,aAAa,CAAG,CACpBC,SAAS,CAAE,GAAG,CACdC,UAAU,CAAE,IAAI,CAChBC,cAAc,CAAE,E,CACR,CAEV,GAAM,CAAAC,cAAc,CAAG,QAAjB,CAAAA,cAAcA,CAAIC,KAAa,CAAY,CAC/C,GAAI,CAAAC,KAAK,CAAG,CAAC,CACb,IAAK,GAAI,CAAAC,KAAK,CAAG,CAAC,CAAEA,KAAK,CAAGF,KAAK,CAACG,MAAM,CAAED,KAAK,EAAE,CAAE,CACjD,GAAM,CAAAE,IAAI,CAAGJ,KAAK,CAACK,UAAU,CAACH,KAAK,CAAC,CACpC,GAAIE,IAAI,EAA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- export declare const version = "4.80.0";
1
+ export declare const version = "4.81.1";
package/dist/version.js CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.version=void 0;var version=exports.version="4.80.0";
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.version=void 0;var version=exports.version="4.81.1";
2
2
  //# sourceMappingURL=version.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"version.js","names":["version","exports"],"sources":["../src/version.ts"],"sourcesContent":["export const version = \"4.80.0\"\n"],"mappings":"6FAAO,GAAM,CAAAA,OAAO,CAAAC,OAAA,CAAAD,OAAA,CAAG,QAAQ","ignoreList":[]}
1
+ {"version":3,"file":"version.js","names":["version","exports"],"sources":["../src/version.ts"],"sourcesContent":["export const version = \"4.81.1\"\n"],"mappings":"6FAAO,GAAM,CAAAA,OAAO,CAAAC,OAAA,CAAAD,OAAA,CAAG,QAAQ","ignoreList":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "posthog-react-native",
3
- "version": "4.80.0",
3
+ "version": "4.81.1",
4
4
  "bugs": {
5
5
  "url": "https://github.com/PostHog/posthog-js/issues"
6
6
  },
@@ -34,8 +34,8 @@
34
34
  "directory": "packages/react-native"
35
35
  },
36
36
  "dependencies": {
37
- "@posthog/core": "^1.57.3",
38
- "@posthog/types": "^1.415.2"
37
+ "@posthog/types": "^1.416.0",
38
+ "@posthog/core": "^1.59.0"
39
39
  },
40
40
  "devDependencies": {
41
41
  "@babel/cli": "^7.19.3",
@@ -73,9 +73,9 @@
73
73
  "typescript": "7.0.2",
74
74
  "@vitest/coverage-v8": "^1.6.1",
75
75
  "vitest": "^1.6.1",
76
- "@posthog-tooling/rollup-utils": "1.1.1",
76
+ "@posthog/react-native-plugin": "2.12.5",
77
77
  "@posthog-tooling/tsconfig-base": "1.1.1",
78
- "@posthog/react-native-plugin": "2.12.5"
78
+ "@posthog-tooling/rollup-utils": "1.1.1"
79
79
  },
80
80
  "peerDependencies": {
81
81
  "@react-native-async-storage/async-storage": ">=1.0.0",