Skip to content

fix: handle consent management filtering per connection - #5716

Closed
saikumarrs wants to merge 6 commits into
masterfrom
feature/sdk-3205-fix-consent-management-based-event-filtering-for-cloud-mode
Closed

saikumarrs wants to merge 6 commits into
masterfrom
feature/sdk-3205-fix-consent-management-based-event-filtering-for-cloud-mode

Conversation

@saikumarrs

@saikumarrs saikumarrs commented Apr 10, 2025 •

Copy link
Copy Markdown
Member

Description

Fixed the consent management based event filtering logic for GCM to prepare in-memory maps based on both source and destination ID. This is because the GCM configuration can be specified per source type unlike the legacy OneTrust and Ketch configuration.

I've also updated the test suites to cover these advanced scenarios.

Ideally, we should store the data per source type and destination ID but making it more specific to the connection level shouldn't hurt. Moreover, when these kind of configurations move to the connection settings in the future, it'll be beneficial.

Without these changes, a destination that's connected to more than one source type and has distinct GCM config for each source types will result in incorrect consent based filtering as the last source type overrides all the data in the map for the destination.

Linear Ticket

https://linear.app/rudderstack/issue/SDK-3205/fix-consent-management-based-event-filtering-for-cloud-mode

Security

  • The code changed/added as part of this pull request won't create any security issues with how the software is being used.

@saikumarrs saikumarrs self-assigned this Apr 10, 2025
@codecov

codecov Bot commented Apr 10, 2025 •

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 77.02%. Comparing base (15ccaac) to head (85eaea6).
Report is 3 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #5716      +/-   ##
==========================================
+ Coverage   77.01%   77.02%   +0.01%     
==========================================
  Files         487      487              
  Lines       66186    66189       +3     
==========================================
+ Hits        50972    50985      +13     
+ Misses      12451    12436      -15     
- Partials     2763     2768       +5     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

Comments suppressed due to low confidence (3)

processor/consent.go:106

  • [nitpick] Consider using consistent naming for the source identifier (e.g. sourceID instead of sourceId) throughout the codebase to improve readability.
func (proc *Handle) getGCMData(sourceId, destinationID, provider string) GenericConsentManagementProviderData {

processor/consent.go:41

  • [nitpick] Update the function comment to document the purpose of the new sourceId parameter, clarifying its role in fetching connection-specific GCM data.
func (proc *Handle) getConsentFilteredDestinations(event types.SingularEventT, sourceId string, destinations []backendconfig.DestinationT) []backendconfig.DestinationT {

processor/consent_test.go:109

  • [nitpick] Consider refactoring the repeated inline definition of connectionInfo into a named struct to improve clarity and maintainability within the test suite.
connectionInfo []struct {

@saikumarrs
saikumarrs marked this pull request as ready for review April 10, 2025 15:24
@cisse21
cisse21 changed the base branch from master to release/1.46.x April 11, 2025 08:33
@cisse21
cisse21 changed the base branch from release/1.46.x to master April 11, 2025 08:33
@cisse21 cisse21 closed this Apr 11, 2025
@cisse21
cisse21 deleted the feature/sdk-3205-fix-consent-management-based-event-filtering-for-cloud-mode branch April 11, 2025 11:44
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.

3 participants