Skip to content

Conversation

@nicolas-chaix-didomi
Copy link
Contributor

SDK Core Fixes (src/)

File Issue Fix
DidomiListener.ts:73-109 Memory leak in setOnReadyListener/setOnErrorListener Added 30s timeout with rejection to clean up orphaned listeners
DidomiListener.ts:43-53 reset() didn't clear vendor listeners Now clears both listeners and vendorStatusListeners maps
DidomiListener.ts:139-144 removeVendorStatusListener set map value to undefined Changed to use delete() to properly remove entries
DidomiListener.ts:30-36, 134-140 No error isolation between listeners Added try-catch around each listener callback
Didomi.ts:140-146 Unhandled promise in addVendorStatusListener Made async and awaited the native call
Didomi.ts:80-93 Missing error handling in onReady/onError Added .catch() for native call errors
Didomi.ts:349 Wrong return type (boolean instead of Promise) Fixed return type
DidomiTypes.ts:118-125 Map shadowed native Map Renamed to StringMap with backward-compatible alias

Sample App Fixes (sample/src/)

File Issue Fix
App.tsx:16-30 Direct array mutation in pushReceivedEvent Changed to immutable update with useCallback
App.tsx:32-80 useEffect missing cleanup function Added return statement to remove listeners on unmount
App.tsx:25-30 registerListener recreated on every render Wrapped in useCallback
App.tsx No error boundaries Added ErrorBoundary component
Setters.tsx Missing gpp_string field (pre-existing TS error) Added missing field

Test App Fixes (test/src/)

File Issue Fix
App.tsx:22-79 Same issues as sample app Same fixes applied
Methods.tsx:104-145 removeAllEventListeners() removed all listeners unnecessarily Changed to only remove specific vendor listener
GetterCall.tsx:17-28 Async errors silently fail Added try-catch with error display
SetterCall.tsx:16-27 Same issue Same fix
helpers/ResultHelper.tsx:6-16 Direct array mutation via sort() Changed to sort a copy [...result].sort()
Setters.tsx Missing gpp_string field Added missing field

Scripts (test/script)

  • Update iOS local tests to use iPhone 17

@nicolas-chaix-didomi nicolas-chaix-didomi marked this pull request as ready for review December 11, 2025 18:15
@nicolas-chaix-didomi nicolas-chaix-didomi merged commit 656a164 into main Dec 22, 2025
4 of 6 checks passed
@nicolas-chaix-didomi nicolas-chaix-didomi deleted the refactor/code-improvements branch December 22, 2025 09:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants