Skip to content
Open
92 changes: 46 additions & 46 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,69 +8,69 @@
"url": "https://github.com/glific/glific-frontend?tab=AGPL-3.0-1-ov-file#readme"
},
"dependencies": {
"@apollo/client": "^3.13.8",
"@apollo/client": "3.14.0",
"@apollo/link-context": "^2.0.0-beta.3",
"@apollo/link-error": "^2.0.0-beta.3",
"@appsignal/javascript": "^1.5.0",
"@appsignal/plugin-breadcrumbs-network": "^1.1.22",
"@appsignal/plugin-path-decorator": "^1.0.16",
"@appsignal/plugin-window-events": "^1.0.24",
"@appsignal/react": "^1.0.29",
"@appsignal/javascript": "^1.6.1",
"@appsignal/plugin-breadcrumbs-network": "^1.1.24",
"@appsignal/plugin-path-decorator": "^1.0.18",
"@appsignal/plugin-window-events": "^1.0.26",
"@appsignal/react": "^1.0.31",
"@date-io/dayjs": "^3.2.0",
"@emoji-mart/data": "^1.2.1",
"@emoji-mart/react": "^1.1.1",
"@emotion/react": "^11.14.0",
"@emotion/styled": "^11.14.1",
"@glific/flow-editor": "^1.43.0-2",
"@lexical/react": "^0.33.0",
"@mui/icons-material": "^7.2.0",
"@mui/material": "^7.2.0",
"@mui/x-date-pickers": "^8.7.0",
"@nyaruka/temba-components": "^0.113.0",
"@lexical/react": "^0.37.0",
"@mui/icons-material": "^7.3.4",
"@mui/material": "^7.3.4",
"@mui/x-date-pickers": "^8.14.0",
"@nyaruka/temba-components": "0.113.0",
"@sentry/integrations": "^7.114.0",
"@sentry/react": "^9.35.0",
"@sentry/vite-plugin": "^3.5.0",
"@stripe/react-stripe-js": "^3.7.0",
"@stripe/stripe-js": "^7.4.0",
"@vitejs/plugin-react": "^4.6.0",
"@sentry/react": "^10.19.0",
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

Verify Sentry v10 migration is complete.

@sentry/react is upgraded from v9.x to v10.19.0, a major version bump with potential breaking changes (e.g., API removals, configuration changes). Ensure the migration guide has been followed and that initialization code in the codebase has been updated accordingly.


🌐 Web query:

What are the breaking changes in Sentry JavaScript SDK v10?

💡 Result:

Key breaking changes in Sentry JavaScript SDK v10 (summary):

  • Bumped OpenTelemetry dependencies to v2 (major dependency change). [1][2]
  • Removed collection of the FID web-vital (First Input Delay). Replace any FID logic/alerts with INP if needed. [1][2]
  • Removed BaseClient — use Client instead. [1]
  • Removed hasTracingEnabled — use hasSpansEnabled. [1]
  • Removed the deprecated internal logger export/type in @sentry/core (use debug / SentryDebugLogger). [1]
  • Removed experimental _experiments.enableLogs and _experiments.beforeSendLog options; use top-level enableLogs and beforeSendLog. [1]
  • _experiments.autoFlushOnFeedback promoted to default behavior (affects Replay). [1]
  • New compatibility ranges for runtimes/frameworks and self-hosting requirements noted (check migration guide for platform-specific details). [1]
  • Later v10.x note: SDKs now control IP address inference based on sendDefaultPii (if you need user IPs set sendDefaultPii: true). [1]

Sources: Sentry migration/changelog and package release notes. [1] Sentry docs — Migrate v9→v10 (breaking changes & details). [2] Package/changelog summaries for v10.0.0.


I'll now search the codebase to verify whether the Sentry v10 migration has been properly implemented.


🏁 Script executed:

#!/bin/bash
# Find Sentry initialization files
fd -e ts -e js -e tsx -e jsx | xargs rg -l 'Sentry\.(init|setClient)' -n -A 5 -B 2

Length of output: 20


🏁 Script executed:

#!/bin/bash
# Search for removed/deprecated Sentry APIs
rg -nP '(BaseClient|hasTracingEnabled|_experiments\.|enableLogs|beforeSendLog)' --type=ts --type=js --type=tsx --type=jsx -C 3

Length of output: 27


🏁 Script executed:

#!/bin/bash
# Look for Sentry configuration files
fd -e ts -e js -e tsx -e jsx | xargs rg -l '@sentry/react' -n

Length of output: 113


🏁 Script executed:

#!/bin/bash
# Check for any migration-related comments or TODOs
rg -nP '(TODO|FIXME|migration|v10|breaking)' -i --type=ts --type=js --type=tsx --type=jsx | grep -i sentry

Length of output: 27


🏁 Script executed:

#!/bin/bash
# Check package.json for Sentry packages and versions
cat package.json | jq '.dependencies, .devDependencies' | grep -i sentry

Length of output: 103


🏁 Script executed:

#!/bin/bash
# Search for usage patterns that might indicate Sentry configuration
rg -nP 'Sentry\.(init|captureException|setUser|setContext)' -C 2 --type=ts --type=tsx --type=js --type=jsx

Length of output: 27


🏁 Script executed:

#!/bin/bash
# Look for old v9-style configurations
rg -nP '(integrations|dsn|tracesSampleRate|enableTracing)' -C 2 --type=ts --type=tsx --type=js --type=jsx | head -50

Length of output: 27


🏁 Script executed:

#!/bin/bash
# Check for OpenTelemetry version in package.json
cat package.json | jq '.dependencies, .devDependencies' | grep -i opentelemetry

Length of output: 0


🏁 Script executed:

#!/bin/bash
# Check for any sentry config files
fd -name '*sentry*' -type f

Length of output: 230


🏁 Script executed:

#!/bin/bash
# Look for the Sentry @sentry/core import which has breaking changes
rg -nP '@sentry/core' -C 2 --type=ts --type=tsx --type=js --type=jsx

Length of output: 27


🏁 Script executed:

#!/bin/bash
# Search for BaseClient usage (removed in v10)
rg -nP 'BaseClient|Client' --type=ts --type=tsx --type=js --type=jsx -C 3 | grep -i sentry

Length of output: 27


🏁 Script executed:

#!/bin/bash
# Look for hasSpansEnabled (v10 replacement for hasTracingEnabled)
rg -nP 'hasSpansEnabled|hasTracingEnabled' --type=ts --type=tsx --type=js --type=jsx

Length of output: 27


🏁 Script executed:

#!/bin/bash
# Search for _experiments usage (removed/changed in v10)
rg -nP '_experiments' --type=ts --type=tsx --type=js --type=jsx -C 2

Length of output: 27


🏁 Script executed:

#!/bin/bash
# Check for logger-related imports from @sentry/core (breaking change)
rg -nP 'from.*@sentry/core.*logger' -i --type=ts --type=tsx --type=js --type=jsx

Length of output: 27


🏁 Script executed:

#!/bin/bash
# Look for sendDefaultPii usage (behavior changed in v10)
rg -nP 'sendDefaultPii' --type=ts --type=tsx --type=js --type=jsx -C 2

Length of output: 27


🏁 Script executed:

#!/bin/bash
# General search for Sentry initialization to understand the scope of migration
rg -nP 'Sentry\.' --type=ts --type=tsx --type=js --type=jsx | head -100

Length of output: 27


🏁 Script executed:

#!/bin/bash
# Check the repository structure to find source files
fd -type f -name '*.ts' -o -name '*.tsx' -o -name '*.js' -o -name '*.jsx' | head -30

Length of output: 170


🏁 Script executed:

#!/bin/bash
# Locate main app entry point or initialization
fd -e ts -e tsx | xargs rg -l 'React\.render|ReactDOM|root\.' -n | head -10

Length of output: 198


🏁 Script executed:

#!/bin/bash
# Check for src directory structure
ls -la src/ 2>/dev/null || echo "No src directory"

Length of output: 1433


🏁 Script executed:

#!/bin/bash
# Look for index or app file
fd -e ts -e tsx -e js | grep -E '(index|app|main|init)' | head -20

Length of output: 217


🏁 Script executed:

#!/bin/bash
# Get all TypeScript/JavaScript files to understand project structure
fd -type f \( -name '*.ts' -o -name '*.tsx' -o -name '*.js' -o -name '*.jsx' \) | head -30

Length of output: 170


🏁 Script executed:

#!/bin/bash
# Read Sentry initialization config
cat src/sentry.config.ts

Length of output: 579


🏁 Script executed:

#!/bin/bash
# Read Apollo client config with Sentry
cat src/config/apolloclient.ts

Length of output: 4967


🏁 Script executed:

#!/bin/bash
# Read ErrorBoundary component
cat src/components/errorboundary/ErrorBoundary.tsx

Length of output: 2281


🏁 Script executed:

#!/bin/bash
# Read logs config
cat src/config/logs.ts

Length of output: 659


🏁 Script executed:

#!/bin/bash
# Search for removed BaseClient (v10 breaking change)
rg -n 'BaseClient' src/

Length of output: 0


🏁 Script executed:

#!/bin/bash
# Search for hasTracingEnabled (removed in v10)
rg -n 'hasTracingEnabled' src/

Length of output: 0


🏁 Script executed:

#!/bin/bash
# Search for _experiments (removed/changed in v10)
rg -n '_experiments' src/

Length of output: 0


🏁 Script executed:

#!/bin/bash
# Search for Sentry.init call
rg -n 'Sentry\.init' src/ -A 10

Length of output: 611


🏁 Script executed:

#!/bin/bash
# Check for any Sentry configuration patterns
rg -n 'Sentry\.' src/ | head -50

Length of output: 952


🏁 Script executed:

#!/bin/bash
# Check full dependencies and devDependencies for all Sentry packages
cat package.json | jq '.dependencies + .devDependencies | keys[] as $k | select($k | contains("sentry")) | "\($k)"'

Length of output: 60


🏁 Script executed:

#!/bin/bash
# Check entire Sentry section in package.json
cat package.json | jq '.dependencies, .devDependencies | to_entries[] | select(.key | startswith("@sentry"))'

Length of output: 166


🏁 Script executed:

#!/bin/bash
# Read index.tsx to see where Sentry is initialized
cat src/index.tsx

Length of output: 1737


🏁 Script executed:

#!/bin/bash
# Check for any imports of deprecated Sentry APIs
rg -n 'import.*from.*@sentry' src/ -A 2

Length of output: 785


🏁 Script executed:

#!/bin/bash
# Look for BaseClient which was removed in v10
rg -n 'class.*BaseClient|extends BaseClient' src/

Length of output: 0


🏁 Script executed:

#!/bin/bash
# Check for logger imports from @sentry/core (breaking change in v10)
rg -n 'logger.*from.*@sentry/core' src/ -i

Length of output: 0


🏁 Script executed:

#!/bin/bash
# Check if there are any integrations being used
rg -n 'new.*Integration|Integrations\.' src/ -C 2 | head -50

Length of output: 0


🏁 Script executed:

#!/bin/bash
# Check vite config for Sentry plugin
find . -name 'vite.config.*' -o -name 'vitest.config.*' | head -5

Length of output: 35


🏁 Script executed:

#!/bin/bash
# Read vite config
cat vite.config.ts 2>/dev/null || cat vite.config.js 2>/dev/null || echo "No vite config found in root"

Length of output: 2847


🏁 Script executed:

#!/bin/bash
# Search for actual usage of @sentry/integrations package
rg -n 'from.*@sentry/integrations' src/

Length of output: 0


🏁 Script executed:

#!/bin/bash
# Search for Sentry.Integrations pattern (old v9 style)
rg -n 'Sentry\.Integrations' src/

Length of output: 0


🏁 Script executed:

#!/bin/bash
# Check if @sentry/integrations is imported anywhere
rg -n '@sentry/integrations' src/

Length of output: 0


🏁 Script executed:

#!/bin/bash
# Search full package.json for context around @sentry/integrations
cat package.json | jq '.dependencies | with_entries(select(.key | contains("sentry"))) | .'

Length of output: 106


Update @sentry/integrations to v10 to complete the migration.

The codebase correctly uses Sentry v10 APIs in initialization and throughout (browserTracingIntegration, browserSessionIntegration, httpClientIntegration, captureConsoleIntegration). However, @sentry/integrations remains at v7.114.0 while @sentry/react is at v10.19.0. This package is unused in the codebase and creates a version mismatch that could cause compatibility issues. It should be updated to v10 or removed entirely.

🤖 Prompt for AI Agents
In package.json around line 31, @sentry/integrations is pinned at v7 while
@sentry/react is at v10, causing a version mismatch; either bump
@sentry/integrations to a v10 release compatible with @sentry/react (e.g.,
^10.x) or remove the @sentry/integrations entry entirely if unused, then update
the lockfile by running npm install or yarn install and verify the build/tests
to ensure no runtime import issues.

"@sentry/vite-plugin": "^4.4.0",
"@stripe/react-stripe-js": "^5.2.0",
"@stripe/stripe-js": "^8.0.0",
"@vitejs/plugin-react": "^5.0.4",
"apollo-absinthe-upload-link": "^1.7.0",
"apollo-link-token-refresh": "^0.7.0",
"axios": "^1.10.0",
"axios": "^1.12.2",
"buffer": "^6.0.3",
"dayjs": "^1.11.13",
"dayjs": "^1.11.18",
"emoji-mart": "^5.6.0",
"formik": "^2.4.6",
"graphql": "^16.11.0",
"graphql-ws": "^6.0.5",
"i18next": "^25.3.1",
"graphql-ws": "^6.0.6",
"i18next": "^25.6.0",
"i18next-browser-languagedetector": "^8.2.0",
"interweave": "^13.1.1",
"interweave-autolink": "^5.1.2",
"lexical": "^0.33.0",
"lexical-beautiful-mentions": "^0.1.47",
"react": "^19.1.0",
"react-dom": "^19.1.0",
"lexical": "^0.37.0",
"lexical-beautiful-mentions": "^0.1.48",
"react": "^19.2.0",
"react-dom": "^19.2.0",
"react-draggable": "^4.5.0",
"react-google-recaptcha-v3": "^1.11.0",
"react-i18next": "^15.6.0",
"react-i18next": "^16.0.1",
"react-image": "^4.1.0",
"react-markdown": "^10.1.0",
"react-media-recorder": "^1.7.1",
"react-media-recorder": "^1.7.2",
"react-phone-input-2": "^2.15.1",
"react-player": "^3.1.0",
"react-player": "^3.3.3",
"react-qr-code": "^2.0.18",
"react-resize-detector": "^12.1.0",
"react-router": "^7.6.3",
"react-resize-detector": "^12.3.0",
"react-router": "^7.9.4",
"react-tiny-link": "^3.6.1",
"react-viewer": "^3.2.2",
"stream-browserify": "^3.0.0",
"util": "^0.12.5",
"uuid": "^11.1.0",
"vite": "^7.0.2",
"vite-plugin-checker": "^0.9.3",
"vite-plugin-svgr": "^4.3.0",
"uuid": "^13.0.0",
"vite": "^7.1.9",
"vite-plugin-checker": "^0.11.0",
"vite-plugin-svgr": "^4.5.0",
"vite-tsconfig-paths": "^5.1.4",
"yup": "^1.6.1"
"yup": "^1.7.1"
},
"scripts": {
"setup": "yarn install --force && yarn run floweditor",
Expand Down Expand Up @@ -104,33 +104,33 @@
]
},
"devDependencies": {
"@testing-library/dom": "^10.4.0",
"@testing-library/jest-dom": "^6.6.3",
"@testing-library/dom": "^10.4.1",
"@testing-library/jest-dom": "^6.9.1",
"@testing-library/react": "^16.3.0",
"@testing-library/user-event": "^14.6.1",
"@types/emoji-mart": "^5.3.0",
"@types/node": "^24.0.10",
"@types/react": "^19.1.8",
"@types/react-dom": "^19.1.6",
"@types/node": "^24.7.2",
"@types/react": "^19.2.2",
"@types/react-dom": "^19.2.2",
"@types/react-google-recaptcha": "^2.1.9",
"@types/react-router": "^5.1.20",
"@types/react-router-dom": "^5.3.3",
Comment on lines 116 to 117
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

Remove legacy React Router v5 type packages

React Router v7 ships its own types. Keeping @types/react-router(-dom) v5 can conflict with the v7 API.

Remove both:

-    "@types/react-router": "^5.1.20",
-    "@types/react-router-dom": "^5.3.3",

🏁 Script executed:

#!/bin/bash
# Sanity check for legacy v5 APIs that would block v7 (Switch, withRouter, useHistory, Redirect).
rg -n -C2 --type=ts --type=tsx '\b(Switch|withRouter|useHistory|Redirect)\b' || true

# Confirm v6/v7 APIs are used (Routes, useNavigate, createBrowserRouter, RouterProvider).
rg -n -C2 --type=ts --type=tsx '\b(Routes|useNavigate|createBrowserRouter|RouterProvider)\b' || true

Length of output: 55


🏁 Script executed:

#!/bin/bash
# Check for legacy v5 APIs in TS/TSX files
rg -n -C2 '\b(Switch|withRouter|useHistory|Redirect)\b' -g '*.ts' -g '*.tsx' --no-ignore || true

# Check for v6/v7 APIs in TS/TSX files
rg -n -C2 '\b(Routes|useNavigate|createBrowserRouter|RouterProvider)\b' -g '*.ts' -g '*.tsx' --no-ignore || true

Length of output: 75817


Remove legacy React Router v5 type packages

Verified no v5 APIs (Switch, useHistory, Redirect, withRouter) are used; v6+/v7 APIs (Routes, useNavigate, etc.) are in place. Remove both entries:

-    "@types/react-router": "^5.1.20",
-    "@types/react-router-dom": "^5.3.3",
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
"@types/react-router": "^5.1.20",
"@types/react-router-dom": "^5.3.3",
🤖 Prompt for AI Agents
In package.json around lines 116-117, remove the legacy React Router v5 type
package entries "@types/react-router" and "@types/react-router-dom" since the
codebase uses React Router v6+/v7 APIs; delete those two lines from
dependencies/devDependencies, run your package manager to uninstall them (npm
uninstall or yarn remove) and then reinstall/update lockfile (npm install or
yarn) to ensure lockfile consistency; verify TypeScript compiles (v6+ has
built-in types) and remove any leftover imports/refs to v5 types if present.

"@types/react-test-renderer": "^19.1.0",
"@types/uuid": "^10.0.0",
"@types/uuid": "^11.0.0",
"@vitest/coverage-istanbul": "^3.2.4",
"@vitest/ui": "^3.2.4",
"eslint-config-airbnb": "^19.0.4",
"eslint-config-prettier": "^10.1.5",
"eslint-config-prettier": "^10.1.8",
"eslint-plugin-import": "^2.32.0",
"eslint-plugin-jsx-a11y": "^6.10.2",
"eslint-plugin-prettier": "^5.5.1",
"eslint-plugin-prettier": "^5.5.4",
"eslint-plugin-react": "^7.37.5",
"eslint-plugin-react-hooks": "^5.2.0",
"eslint-plugin-react-hooks": "^7.0.0",
"i18next-parser": "^9.3.0",
"jsdom": "^26.1.0",
"jsdom": "^27.0.0",
"prettier": "^3.6.2",
"react-test-renderer": "^19.1.0",
"typescript": "^5.8.3",
"react-test-renderer": "^19.2.0",
"typescript": "^5.9.3",
"vitest": "^3.2.4",
"yarn-upgrade-all": "^0.7.5"
}
Expand Down
16 changes: 13 additions & 3 deletions src/setupTests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,17 @@ window.fetch = vi.fn() as any;

global.URL.createObjectURL = vi.fn();

if (!globalThis.TextEncoder || !globalThis.TextDecoder) {
globalThis.TextEncoder = TextEncoder;
globalThis.TextDecoder = TextDecoder as any;
if (!globalThis.TextEncoder) {
Object.defineProperty(globalThis, 'TextEncoder', {
value: TextEncoder,
writable: true,
configurable: true,
});
}
if (!globalThis.TextDecoder) {
Object.defineProperty(globalThis, 'TextDecoder', {
value: TextDecoder,
writable: true,
configurable: true,
});
}
Loading
Loading