Update inapp sdk module to 0.29.0#44
Conversation
📝 WalkthroughWalkthroughThis PR upgrades the SDK from version 0.25.x to 0.29.0 and introduces theme customization support across iOS, Android, and TypeScript interfaces. It adds logging infrastructure with new LogLevel and LogEventType enums, plus a parseLog method for structured log processing. The example app demonstrates TEE mode selection and log consumer integration. Changes
Sequence Diagram(s)sequenceDiagram
actor User
participant App as App/ReclaimVerification
participant Parser as parseLog()
participant Converter as fromTimeStampToDate()
participant LogEntry as LogEntry Object
User->>App: Receives raw log JSON string
App->>Parser: parseLog(logJsonString)
Parser->>Parser: Parse JSON structure
alt timestamp present
Parser->>Converter: fromTimeStampToDate(nanosecond ts)
Converter->>Converter: Convert nanoseconds to Date
Converter-->>Parser: Date object
end
Parser->>LogEntry: Construct LogEntry with<br/>logLine, ts, datetime,<br/>type, sessionId, logLevel,<br/>eventType
LogEntry-->>App: Structured LogEntry
App-->>User: Return parsed log data
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 Fix all issues with AI agents
In `@documentation/migration.md`:
- Line 5: Fix the spelling of "overriden" to "overridden" throughout the
migration.md document; search for the misspelling (e.g., in lines referencing
the ReclaimInAppSdk cocoapod) and replace each occurrence (including the
instances noted in the comment) so all instances use the correct double‑d
"overridden".
- Line 167: The sentence in migration.md mixes a specific old version with the
latest release and is inconsistent; update the line referencing ReclaimInAppSdk
so it either uses "an older version" (instead of the incorrect "0.2.0") or
consistently names the old example and the latest release; for example, change
the text around the symbol "ReclaimInAppSdk" to read: "Make sure if you are
using an older version of the ReclaimInAppSdk cocoapod (e.g., 0.2.0) or have
overridden this dependency in your Podfile, update it — the latest version on
cocoapods.org is 0.29.0." Ensure the change replaces the literal "0.2.0" or
rephrases to match other migration sections that use "latest versions."
In `@user-workspace/src/App.tsx`:
- Around line 411-415: The onPress handler for selecting a TEE option is closing
the wrong dropdown and clearing the provider input: replace the call to
setShowDropdown(false) with setShowTeeDropdown(false) and remove the
setInputText('') call so selecting a TEE does not wipe the provider ID/URL;
update the handler that sets setSelectedTeeOptionValue(option.value) accordingly
(keep that call) so only the TEE dropdown is closed and the input remains
unchanged.
🧹 Nitpick comments (3)
src/index.tsx (1)
915-923: Wrap JSON.parse in try/catch to handle malformed log strings.If
logcontains invalid JSON,JSON.parsewill throw aSyntaxError. Since this is a public API that processes external log data, adding error handling would improve robustness.♻️ Suggested improvement
override parseLog( log: string ): ReclaimVerification.LogEntry { - let data = JSON.parse(log) as ReclaimVerification.LogEntry; - if (data.ts) { - data.datetime = this.fromTimeStampToDate(data.ts); + try { + let data = JSON.parse(log) as ReclaimVerification.LogEntry; + if (data.ts) { + data.datetime = this.fromTimeStampToDate(data.ts); + } + return data; + } catch (e) { + // Return a minimal LogEntry on parse failure + return { + logLine: log, + ts: '', + datetime: new Date(), + type: 'unknown', + sessionId: 'unknown', + providerId: '', + appId: '', + logLevel: 'WARNING', + }; } - return data; }ios/inapp_rn_sdk/Api.swift (1)
206-213: Verify override semantics forisRecurring/themedefaults.
isRecurringnow defaults tofalsewhen nil, andthemeis passed through verbatim. If the SDK treats “unset” differently from explicit values, this could unintentionally override defaults. Consider normalizing empty themes and confirm whethernilshould remain unset forisRecurring.♻️ Optional normalization for empty theme
- appInfoOverrides = .init( - appName: appInfo.appName, - appImageUrl: appInfo.appImageUrl, - isRecurring: appInfo.isRecurring?.boolValue ?? false, - theme: appInfo.theme - ) + let theme = (appInfo.theme?.isEmpty == false) ? appInfo.theme : nil + appInfoOverrides = .init( + appName: appInfo.appName, + appImageUrl: appInfo.appImageUrl, + isRecurring: appInfo.isRecurring?.boolValue ?? false, + theme: theme + )ios/InappRnSdk.mm (1)
392-400: Normalize empty theme to nil before bridging.If the SDK expects “unset” instead of an empty string, guard against empty theme values to avoid overriding defaults.
♻️ Suggested normalization
- NSString *_Nullable theme = nil; - if (appInfo.theme() != nil) { - theme = appInfo.theme(); - } + NSString *_Nullable theme = nil; + if (appInfo.theme() != nil && appInfo.theme().length > 0) { + theme = appInfo.theme(); + }
| ## 0.15.0 | ||
|
|
||
| - Make sure if you are using the latest versions of `ReclaimInAppSdk` cocoapod if you have overriden this dependency in your `Podfile`. Latest version on [cocoapods.org is 0.25.0](https://cocoapods.org/pods/ReclaimInAppSdk). | ||
| - Make sure if you are using the latest versions of `ReclaimInAppSdk` cocoapod if you have overriden this dependency in your `Podfile`. Latest version on [cocoapods.org is 0.29.0](https://cocoapods.org/pods/ReclaimInAppSdk). |
There was a problem hiding this comment.
Fix spelling: "overriden" → "overridden"
This typo appears throughout the migration document. The correct spelling is "overridden" (double 'd').
Suggested fix
-- Make sure if you are using the latest versions of `ReclaimInAppSdk` cocoapod if you have overriden this dependency in your `Podfile`. Latest version on [cocoapods.org is 0.29.0](https://cocoapods.org/pods/ReclaimInAppSdk).
+- Make sure if you are using the latest versions of `ReclaimInAppSdk` cocoapod if you have overridden this dependency in your `Podfile`. Latest version on [cocoapods.org is 0.29.0](https://cocoapods.org/pods/ReclaimInAppSdk).Apply the same fix to lines 11, 17, 23, 29, 35, 41, 49, 128, and 167.
📝 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.
| - Make sure if you are using the latest versions of `ReclaimInAppSdk` cocoapod if you have overriden this dependency in your `Podfile`. Latest version on [cocoapods.org is 0.29.0](https://cocoapods.org/pods/ReclaimInAppSdk). | |
| - Make sure if you are using the latest versions of `ReclaimInAppSdk` cocoapod if you have overridden this dependency in your `Podfile`. Latest version on [cocoapods.org is 0.29.0](https://cocoapods.org/pods/ReclaimInAppSdk). |
🧰 Tools
🪛 LanguageTool
[grammar] ~5-~5: Ensure spelling is correct
Context: ... ReclaimInAppSdk cocoapod if you have overriden this dependency in your Podfile. Late...
(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)
🤖 Prompt for AI Agents
In `@documentation/migration.md` at line 5, Fix the spelling of "overriden" to
"overridden" throughout the migration.md document; search for the misspelling
(e.g., in lines referencing the ReclaimInAppSdk cocoapod) and replace each
occurrence (including the instances noted in the comment) so all instances use
the correct double‑d "overridden".
| ### iOS | ||
|
|
||
| - Make sure if you are using the `0.2.0` version of `ReclaimInAppSdk` cocoapod if you have overriden this dependency in your `Podfile`. Latest version on [cocoapods.org is 0.25.0](https://cocoapods.org/pods/ReclaimInAppSdk). | ||
| - Make sure if you are using the `0.2.0` version of `ReclaimInAppSdk` cocoapod if you have overriden this dependency in your `Podfile`. Latest version on [cocoapods.org is 0.29.0](https://cocoapods.org/pods/ReclaimInAppSdk). |
There was a problem hiding this comment.
Inconsistent version reference
This line mentions "if you are using the 0.2.0 version" but then states the latest version is 0.29.0. The sentence structure appears inconsistent with other migration sections that say "latest versions" instead of a specific old version.
Suggested fix
-- Make sure if you are using the `0.2.0` version of `ReclaimInAppSdk` cocoapod if you have overriden this dependency in your `Podfile`. Latest version on [cocoapods.org is 0.29.0](https://cocoapods.org/pods/ReclaimInAppSdk).
+- Make sure if you are using the latest versions of `ReclaimInAppSdk` cocoapod if you have overridden this dependency in your `Podfile`. Latest version on [cocoapods.org is 0.29.0](https://cocoapods.org/pods/ReclaimInAppSdk).📝 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.
| - Make sure if you are using the `0.2.0` version of `ReclaimInAppSdk` cocoapod if you have overriden this dependency in your `Podfile`. Latest version on [cocoapods.org is 0.29.0](https://cocoapods.org/pods/ReclaimInAppSdk). | |
| - Make sure if you are using the latest versions of `ReclaimInAppSdk` cocoapod if you have overridden this dependency in your `Podfile`. Latest version on [cocoapods.org is 0.29.0](https://cocoapods.org/pods/ReclaimInAppSdk). |
🧰 Tools
🪛 LanguageTool
[grammar] ~167-~167: Ensure spelling is correct
Context: ... ReclaimInAppSdk cocoapod if you have overriden this dependency in your Podfile. Late...
(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)
🤖 Prompt for AI Agents
In `@documentation/migration.md` at line 167, The sentence in migration.md mixes a
specific old version with the latest release and is inconsistent; update the
line referencing ReclaimInAppSdk so it either uses "an older version" (instead
of the incorrect "0.2.0") or consistently names the old example and the latest
release; for example, change the text around the symbol "ReclaimInAppSdk" to
read: "Make sure if you are using an older version of the ReclaimInAppSdk
cocoapod (e.g., 0.2.0) or have overridden this dependency in your Podfile,
update it — the latest version on cocoapods.org is 0.29.0." Ensure the change
replaces the literal "0.2.0" or rephrases to match other migration sections that
use "latest versions."
| onPress={() => { | ||
| setSelectedTeeOptionValue(option.value); | ||
| setInputText(''); | ||
| setShowDropdown(false); | ||
| }} |
There was a problem hiding this comment.
Bug: Wrong dropdown is closed and input is unnecessarily cleared when selecting TEE mode.
When a TEE option is selected:
setShowDropdown(false)is called instead ofsetShowTeeDropdown(false)- this closes the wrong modalsetInputText('')clears the provider ID/URL input, which is undesirable as TEE mode selection is independent of the verification input
Compare with the verification mode dropdown handler at lines 287-291 which correctly clears input (since changing verification mode invalidates the previous input format).
🐛 Proposed fix
onPress={() => {
setSelectedTeeOptionValue(option.value);
- setInputText('');
- setShowDropdown(false);
+ setShowTeeDropdown(false);
}}📝 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.
| onPress={() => { | |
| setSelectedTeeOptionValue(option.value); | |
| setInputText(''); | |
| setShowDropdown(false); | |
| }} | |
| onPress={() => { | |
| setSelectedTeeOptionValue(option.value); | |
| setShowTeeDropdown(false); | |
| }} |
🤖 Prompt for AI Agents
In `@user-workspace/src/App.tsx` around lines 411 - 415, The onPress handler for
selecting a TEE option is closing the wrong dropdown and clearing the provider
input: replace the call to setShowDropdown(false) with setShowTeeDropdown(false)
and remove the setInputText('') call so selecting a TEE does not wipe the
provider ID/URL; update the handler that sets
setSelectedTeeOptionValue(option.value) accordingly (keep that call) so only the
TEE dropdown is closed and the input remains unchanged.
Summary by CodeRabbit
New Features
Improvements
Chores
✏️ Tip: You can customize this high-level summary in your review settings.