Skip to content

feat: added logUserSessionsData method to android interface#13

Merged
miguelccodev merged 4 commits intomainfrom
feat--mr-56--added-user-sessions-data
Mar 9, 2026
Merged

feat: added logUserSessionsData method to android interface#13
miguelccodev merged 4 commits intomainfrom
feat--mr-56--added-user-sessions-data

Conversation

@miguelccodev
Copy link
Contributor

@miguelccodev miguelccodev commented Mar 9, 2026

Changes

  • feat: added logUserSessionsData method to android interface
  • chore: unit tests

How to test

  • npm run test

Ref: MR-56

Summary by CodeRabbit

  • New Features

    • Extended the application logging system to support user sessions data collection in addition to summary data, with automatic payload structuring, timestamp generation, and optional parameter support.
  • Tests

    • Added test suite to verify user sessions data logging functionality, including payload structure validation, optional parameters, and timestamp formatting verification.

@miguelccodev miguelccodev self-assigned this Mar 9, 2026
@coderabbitai
Copy link

coderabbitai bot commented Mar 9, 2026

Warning

Rate limit exceeded

@miguelccodev has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 3 minutes and 7 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 45e5268c-2729-40cc-929b-ceb323f4bc99

📥 Commits

Reviewing files that changed from the base of the PR and between 7051f6c and 9837c08.

📒 Files selected for processing (1)
  • src/android-interface/android-interface.ts
📝 Walkthrough

Walkthrough

This pull request extends the AndroidInterface to support logging user session data. Two new public methods are introduced—logSummaryData() and logUserSessionsData()—that construct payloads with base parameters, data, options, and timestamps, then validate and send them via the Android bridge. Helper method visibility was adjusted to protected, and the supported collection types were expanded to include 'user_sessions_data'.

Changes

Cohort / File(s) Summary
Type definitions
src/android-interface/types.d.ts
Expanded AppEventPayloadCollection type to support both 'summary_data' and 'user_sessions_data' collection values.
Implementation
src/android-interface/android-interface.ts
Added logSummaryData() and logUserSessionsData() public methods with consistent payload construction (collection type, baseParams, data, options, timestamp). Adjusted visibility of getBaseParams(), validatePayload(), and createTimestamp() to protected.
Tests
src/android-interface/android-interface.spec.ts
Added new test suite validating user session data logging: verifies complete payload structure (collection type, data equality, string-formatted user identifiers and timestamp), and confirms optional processing instructions are included when provided.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • Rajesh1041

Poem

🐰 The interface now sings a session's tale,
With payloads wrapped in timestamps without fail,
Base params and data dance in the light,
Protected helpers guard the payload right,
User sessions logged with Android's might! ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: adding the logUserSessionsData method to the AndroidInterface class, which is the primary focus across all modified files.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat--mr-56--added-user-sessions-data

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@src/android-interface/android-interface.ts`:
- Around line 73-75: logUserSessionsData currently logs debug output but
continues to validate and call the bridge, unlike logSummaryData; change
logUserSessionsData so that if this.options.debug is truthy it logs and then
returns immediately (i.e., early return) to suppress the bridge write, mirroring
logSummaryData's behavior; locate the logUserSessionsData method and add the
early return right after the console.log that references this.options.debug so
validation and window[...].call are skipped in debug mode.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 720bfe41-c5c4-4fa2-88af-fbd13dd8a65f

📥 Commits

Reviewing files that changed from the base of the PR and between 8a5d98f and 7051f6c.

📒 Files selected for processing (3)
  • src/android-interface/android-interface.spec.ts
  • src/android-interface/android-interface.ts
  • src/android-interface/types.d.ts

@miguelccodev miguelccodev merged commit f015306 into main Mar 9, 2026
3 checks passed
@miguelccodev
Copy link
Contributor Author

🎉 This PR is included in version 1.10.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant