Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add consent management and support for onetrust cmp #882

Merged
merged 5 commits into from
Oct 2, 2023
Merged

Conversation

zikaari
Copy link
Contributor

@zikaari zikaari commented Sep 20, 2023

This patch implements the work laid out in mobile consent management SDD.

A great starting point for reviewers to check compliance with the SDD is OneTrust.test.ts file.

Copy link
Contributor

@oscb oscb left a comment

Choose a reason for hiding this comment

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

I think this looks really good!
Left a few comments. Just 2 major things;

  • RxJS, can we simplify?
  • Storage, let's make sure this can work offline too

Left a conversation there about the behavior that libraries should take when the consent information is not available. Might need some slight changes.

packages/core/src/plugins/ConsentPlugin.ts Outdated Show resolved Hide resolved
packages/core/src/plugins/ConsentPlugin.ts Outdated Show resolved Hide resolved
packages/core/src/plugins/ConsentPlugin.ts Outdated Show resolved Hide resolved
packages/core/src/plugins/ConsentPlugin.ts Show resolved Hide resolved
packages/core/src/plugins/ConsentPlugin.ts Outdated Show resolved Hide resolved
packages/core/src/plugins/ConsentPlugin.ts Show resolved Hide resolved
packages/core/src/plugins/ConsentPlugin.ts Outdated Show resolved Hide resolved
packages/plugins/plugin-onetrust/src/OTProvider.ts Outdated Show resolved Hide resolved
packages/plugins/plugin-onetrust/src/OTProvider.ts Outdated Show resolved Hide resolved
@zikaari zikaari marked this pull request as ready for review September 22, 2023 00:08
@zikaari zikaari requested a review from oscb September 22, 2023 00:08
@oscb
Copy link
Contributor

oscb commented Sep 22, 2023

🚢 I already approved but saw the Android Integration tests failing.
I don't see anything in your changes that could be impacting those tests, might be just a blip in Detox. The only other possibility I can think of is if Detox has an issue with NPM 18 as I see you bumped this value, although I would be surprised if it was only impacting Android.

I just put a retry run. Let's see if that clears it. Else might require some investigation.

Copy link

@chrisradek chrisradek left a comment

Choose a reason for hiding this comment

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

Overall looks good to me! (Though I'm not very familiar with this codebase)

packages/plugins/plugin-onetrust/README.md Show resolved Hide resolved
@@ -0,0 +1,85 @@
{
"name": "@segment/analytics-react-native-plugin-onetrust",
"version": "0.0.0",

Choose a reason for hiding this comment

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

What version will this end up getting published as?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Depends on what we decide while running yarn version command - whether we want to release it as 1.0.0 or 1.0.0-rc or 1.0.0-alpha etc. I don't have knowledge on what our stance is around shipping this entire feature.

Copy link
Contributor

Choose a reason for hiding this comment

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

Seems like for Kotlin it is being released as 1.0.x right now
I think if we change the commit message to feat: consent-management ti will release it properly

@@ -0,0 +1,134 @@
import {
Plugin,
type SegmentClient,
Copy link

Choose a reason for hiding this comment

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

I didn't know about this syntax!

},
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'],
modulePaths: [compilerOptions.baseUrl],
moduleNameMapper: pathsToModuleNameMapper(compilerOptions.paths),
Copy link

Choose a reason for hiding this comment

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

Didn't know about this helper!

import { ConsentPlugin } from '@segment/analytics-react-native';

import { OTPublishersNativeSDK, OTCategoryConsentProvider } from './OTProvider';

Copy link

Choose a reason for hiding this comment

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

Very clean!

Copy link

@silesky silesky left a comment

Choose a reason for hiding this comment

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

LGTM
Looks very clean 🚀

@oscb oscb merged commit 375684f into master Oct 2, 2023
4 checks passed
@oscb oscb deleted the consent_management branch October 2, 2023 20:21
oscb pushed a commit that referenced this pull request Oct 20, 2023
## [@segment/analytics-react-native-v2.17.0](https://github.com/segmentio/analytics-react-native/compare/@segment/analytics-react-native-v2.16.1...@segment/analytics-react-native-v2.17.0) (2023-10-20)

### Features

* add consent management and support for onetrust cmp ([#882](#882)) ([375684f](375684f))

### Bug Fixes

* add unknown option to current state ([#887](#887)) ([a0a3b0d](a0a3b0d))
* change content type to json ([#885](#885)) ([e8ddeb4](e8ddeb4))
oscb pushed a commit that referenced this pull request Oct 20, 2023
## @segment/analytics-react-native-plugin-onetrust-v1.0.0 (2023-10-20)

### Features

* add consent management and support for onetrust cmp ([#882](#882)) ([375684f](375684f))
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