Skip to content

COR-6360: support AI Data consent - #77

Open
tungntEmotiv wants to merge 2 commits into
developfrom
COR-6360
Open

COR-6360: support AI Data consent#77
tungntEmotiv wants to merge 2 commits into
developfrom
COR-6360

Conversation

@tungntEmotiv

@tungntEmotiv tungntEmotiv commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

The PR to support AI Data consent feature.

Please help to review. Thanks


Rovo Dev code review: Rovo Dev has reviewed this pull request
Any suggestions or improvements have been posted as pull request comments.

Comment thread Src/Types.cs Outdated
@atlassian

atlassian Bot commented Aug 14, 2026

Copy link
Copy Markdown

The issue is ready for review, and the below acceptance criteria have been met:

  • ✅ Support setting accepted/rejected for AI Data usage consent via Cortex API setAiDataConsent

Code Reviewer could not determine whether the following acceptance criteria have been met:

  • Support checking AI Data usage consent (accepted or not) via Cortex API getUserInformation

Check Jira issue

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adds first-class support for the “AI Data consent” feature to the Unity plugin by introducing a consent model and exposing new Cortex request/response flows through the public Unity-facing interfaces.

Changes:

  • Introduces AIDataConsent model to represent consent state and policy URL.
  • Adds getAiDataConsent / setAiDataConsent request methods and response events in CortexClient.
  • Exposes async GetAIDataConsent / SetAIDataConsent APIs via Authorizer, EmotivUnityItf, and BCIGameItf.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
Src/Types.cs Adds AIDataConsent data model for parsing Cortex consent payloads.
Src/CortexClient.cs Adds consent events + response handling + request methods for Cortex consent APIs.
Src/Authorizer.cs Adds async Task-based wrappers around the new consent APIs.
Src/EmotivUnityItf.cs Exposes consent APIs on the Unity interface.
Src/BCIGameItf.cs Exposes consent APIs on the game-facing interface and documents them.
Suppressed comments (2)

Src/Authorizer.cs:234

  • OnGetAiDataConsentDone logs consent.Accepted without null checks and never clears _getAiDataConsentTcs. If consent is null, logging will throw; and keeping the TCS reference around can cause later calls to incorrectly reuse/combine results.
        private void OnGetAiDataConsentDone(object sender, AIDataConsent consent)
        {
            UnityEngine.Debug.Log("OnGetAiDataConsentDone: " + consent.Accepted);
            _getAiDataConsentTcs?.TrySetResult(consent);
        }

Src/Authorizer.cs:252

  • OnSetAiDataConsentDone logs consent.Accepted without null checks and never clears _setAiDataConsentTcs. If consent is null, logging will throw; and keeping the TCS reference around can affect subsequent calls.
        private void OnSetAiDataConsentDone(object sender, AIDataConsent consent)
        {
            UnityEngine.Debug.Log("OnSetAiDataConsentDone: " + consent.Accepted);
            _setAiDataConsentTcs?.TrySetResult(consent);
        }

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread Src/Types.cs
Comment thread Src/CortexClient.cs
Comment thread Src/CortexClient.cs
Comment thread Src/Authorizer.cs
Comment thread Src/Authorizer.cs
Comment thread Src/BCIGameItf.cs
Comment thread Src/Authorizer.cs
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.

2 participants