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

fix: improve getRudderContext api return type #273

Merged

Conversation

1abhishekpandey
Copy link
Contributor

@1abhishekpandey 1abhishekpandey commented Oct 20, 2023

Description of the change

  • Added the IRudderContext interface in the React Native SDK, which basically defines the context fields. Now this interface is also exported.
  • Change the getRudderContext API return type from void to IRudderContext | null.
  • Updated the sample app to use this API.
  • Also, added GDPR API in the sample app.

Type of change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Related issues

Fix #263

Checklists

Development

  • Lint rules pass locally
  • The code changed/added as part of this pull request has been covered with tests
  • All tests related to the changed code pass in development

Code review

  • This pull request has a descriptive title and information useful to a reviewer. There may be a screenshot or screencast attached
  • "Ready for review" label attached to the PR and reviewers mentioned in a comment
  • Changes have been reviewed by at least one other engineer
  • Issue from task tracker has a link to this pull request

bardisg
bardisg previously approved these changes Oct 25, 2023
bardisg
bardisg previously approved these changes Oct 25, 2023
desusai7
desusai7 previously approved these changes Oct 25, 2023
@sonarcloud
Copy link

sonarcloud bot commented Oct 25, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

0.0% 0.0% Coverage
0.0% 0.0% Duplication

@1abhishekpandey 1abhishekpandey merged commit e013dd6 into develop Oct 31, 2023
13 checks passed
@1abhishekpandey 1abhishekpandey deleted the fix/sdk-756-fix-getruddercontext-api-in-react-native branch October 31, 2023 10:01
Copy link

@elliotdickison elliotdickison left a comment

Choose a reason for hiding this comment

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

@1abhishekpandey Was this merged? If so could you remove it? We would prefer not to have anything logged when fetching context.

UPDATE: this comment was supposed to reference the new console.log statement but the GitHub mobile UI threw me off haha

@1abhishekpandey
Copy link
Contributor Author

Hey @elliotdickison,
Just to clarify, the change is merged, and the console.log statement was added to the sample app, not the SDK. I hope this addresses your concern.

@elliotdickison
Copy link

Ah I missed that, thanks!

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

Successfully merging this pull request may close these issues.

BUG : Incorrect TypeScript type for getRudderContext
4 participants