From 48be75f5ca38f8f8e24695560c109bc5661e4f58 Mon Sep 17 00:00:00 2001
From: Stephanie Freitag <stephanie.freitag@holi.team>
Date: Wed, 29 Jan 2025 18:25:33 +0100
Subject: [PATCH] NOISSUE: add polyfill for uuid

---
 apps/mobile/index.ts     |  3 ++-
 apps/mobile/package.json |  2 ++
 yarn.lock                | 27 +++++++++++++++++++++++++++
 3 files changed, 31 insertions(+), 1 deletion(-)

diff --git a/apps/mobile/index.ts b/apps/mobile/index.ts
index 2203517299..564058c68a 100644
--- a/apps/mobile/index.ts
+++ b/apps/mobile/index.ts
@@ -8,6 +8,7 @@ import 'intl/locale-data/jsonp/de'
 import 'intl/locale-data/jsonp/en'
 import 'react-native-gesture-handler'
 import 'react-native-url-polyfill/auto'
+import 'react-native-get-random-values' // Polyfill for uuid
 
 import { HoliError } from '@holi/core/errors/classes/HoliError'
 import { environment } from '@holi/core/helpers/environment'
@@ -34,7 +35,7 @@ Sentry.init({
       response?.didCallNativeInit ? 'Sentry successfully initialized in env ' + environment : 'Sentry not initialized'
     )
   },
-  beforeSend: function (event, hint) {
+  beforeSend: (event, hint) => {
     const exception = hint.originalException
 
     // The right-hand side operators of instanceof must be objects, otherwise an exception is thrown.
diff --git a/apps/mobile/package.json b/apps/mobile/package.json
index 85ee3f2a41..54ea47e068 100644
--- a/apps/mobile/package.json
+++ b/apps/mobile/package.json
@@ -65,6 +65,7 @@
     "react-native-calendars": "^1.1306.0",
     "react-native-controlled-mentions": "^2.2.5",
     "react-native-gesture-handler": "~2.16.1",
+    "react-native-get-random-values": "^1.11.0",
     "react-native-image-crop-picker": "^0.41.2",
     "react-native-image-pan-zoom": "^2.1.12",
     "react-native-keyboard-controller": "^1.15.2",
@@ -91,6 +92,7 @@
     "@types/lodash.partition": "^4.6.9",
     "@types/lodash.shuffle": "^4.2.9",
     "@types/react": "~18.2.79",
+    "@types/react-native-get-random-values": "^1",
     "eslint": "^8.33.0",
     "find-yarn-workspace-root": "^2.0.0",
     "jest-each": "^29.6.3",
diff --git a/yarn.lock b/yarn.lock
index 2fc698300d..0abb039994 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -5739,6 +5739,7 @@ __metadata:
     "@types/lodash.partition": "npm:^4.6.9"
     "@types/lodash.shuffle": "npm:^4.2.9"
     "@types/react": "npm:~18.2.79"
+    "@types/react-native-get-random-values": "npm:^1"
     apollo-link-timeout: "npm:^4.0.0"
     eslint: "npm:^8.33.0"
     expo: "npm:~51.0.38"
@@ -5787,6 +5788,7 @@ __metadata:
     react-native-calendars: "npm:^1.1306.0"
     react-native-controlled-mentions: "npm:^2.2.5"
     react-native-gesture-handler: "npm:~2.16.1"
+    react-native-get-random-values: "npm:^1.11.0"
     react-native-image-crop-picker: "npm:^0.41.2"
     react-native-image-pan-zoom: "npm:^2.1.12"
     react-native-keyboard-controller: "npm:^1.15.2"
@@ -13399,6 +13401,13 @@ __metadata:
   languageName: node
   linkType: hard
 
+"@types/react-native-get-random-values@npm:^1":
+  version: 1.8.2
+  resolution: "@types/react-native-get-random-values@npm:1.8.2"
+  checksum: 10c0/66c0268151d0673bff88828d82d4087aeabbe29a8ffe433f50e2593cd04872fc890f0d2660203435d13412b10d866d24a3ab72981cf481e5676ccf88de12c235
+  languageName: node
+  linkType: hard
+
 "@types/react-transition-group@npm:^4.4.11":
   version: 4.4.11
   resolution: "@types/react-transition-group@npm:4.4.11"
@@ -20271,6 +20280,13 @@ __metadata:
   languageName: node
   linkType: hard
 
+"fast-base64-decode@npm:^1.0.0":
+  version: 1.0.0
+  resolution: "fast-base64-decode@npm:1.0.0"
+  checksum: 10c0/6d8feab513222a463d1cb58d24e04d2e04b0791ac6559861f99543daaa590e2636d040d611b40a50799bfb5c5304265d05e3658b5adf6b841a50ef6bf833d821
+  languageName: node
+  linkType: hard
+
 "fast-decode-uri-component@npm:^1.0.1":
   version: 1.0.1
   resolution: "fast-decode-uri-component@npm:1.0.1"
@@ -29253,6 +29269,17 @@ __metadata:
   languageName: node
   linkType: hard
 
+"react-native-get-random-values@npm:^1.11.0":
+  version: 1.11.0
+  resolution: "react-native-get-random-values@npm:1.11.0"
+  dependencies:
+    fast-base64-decode: "npm:^1.0.0"
+  peerDependencies:
+    react-native: ">=0.56"
+  checksum: 10c0/2ce71f1ab7f5b36d4a9dd59cc80b4aa75526f047c6680a7f1a388fa8b9a62efdacaf7b7de3be593c73e882773b2eee74916b00f7c8b158e40b46388998218586
+  languageName: node
+  linkType: hard
+
 "react-native-image-crop-picker@npm:^0.41.2":
   version: 0.41.4
   resolution: "react-native-image-crop-picker@npm:0.41.4"
-- 
GitLab