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: ensure unsubscribe event captures user context for logged-out users #36247

Merged

Conversation

hassan-raza-1
Copy link
Contributor

Description

When a user unsubscribed from email digests using a browser where they were not logged in, the event tracker (tracker.emit) did not store the user context. As a result, the user_id and username fields were recorded as NULL in the tracking_events_with_metadata table.

This PR fixes the issue by ensuring that, even if the user is not logged in, the event captures and stores the user context from the unsubscribe request. The event payload now always includes user_id and username, preventing data inconsistencies in tracking.

Related ticket

https://2u-internal.atlassian.net/browse/INF-1790

Testing instructions

  1. Click on the unsubscribe link for email digests.
  2. In a browser where the user is not logged in, confirm the unsubscription.
  3. In Snowflake, verify that the recorded event includes the correct username and user_id.

@awais-ansari awais-ansari merged commit 5db14d2 into openedx:master Feb 18, 2025
49 checks passed
@edx-pipeline-bot
Copy link
Contributor

2U Release Notice: This PR has been deployed to the edX staging environment in preparation for a release to production.

@edx-pipeline-bot
Copy link
Contributor

2U Release Notice: This PR has been deployed to the edX production environment.

1 similar comment
@edx-pipeline-bot
Copy link
Contributor

2U Release Notice: This PR has been deployed to the edX production environment.

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.

5 participants