Skip to content

[MBL-19874][All] Privacy Consent dialog#3613

Open
hermannakos wants to merge 22 commits intomasterfrom
MBL-19874-privacy-consent-dialog
Open

[MBL-19874][All] Privacy Consent dialog#3613
hermannakos wants to merge 22 commits intomasterfrom
MBL-19874-privacy-consent-dialog

Conversation

@hermannakos
Copy link
Copy Markdown
Collaborator

@hermannakos hermannakos commented Mar 31, 2026

refs: MBL-19874, MBL-19966
affects: Student, Teacher, Parent
release note: Added privacy consent dialog for anonymous analytics (Pendo).

Summary

  • Implements the Privacy Consent bottom sheet dialog shown on first app open when the cookie_consent_necessary account-level feature flag is enabled (MBL-19874)
  • Moves Pendo consent storage from remote/web to device-local ApiPrefs.mobileConsent (nullable boolean: null = not yet decided, true/false = decided) — replaces the previous network API call (MBL-19966)
  • When consent is granted from Settings > Legal, a Pendo session is started immediately (fire-and-forget via GlobalScope)
  • When consent is revoked, the active Pendo session is ended
  • OAuth session requests include the local mobileConsent state
  • Dialog is non-dismissible (no back/swipe) when shown on login; dismissible when opened from Settings

Test plan

Enable the cookie_consent_necessary feature flag, then:

  1. First app open: consent dialog appears and cannot be dismissed without choosing
  2. Tap Allow: dialog closes, Pendo tracking starts, consent stored locally
  3. Tap Decline: dialog closes, Pendo tracking disabled, consent stored locally
  4. Subsequent app opens: consent dialog does NOT appear again
  5. Go to Settings > Legal > Cookie Consent: dialog opens and can be dismissed via back/swipe
  6. Change consent to Allow from Settings: Pendo session starts immediately
  7. Change consent to Decline from Settings: Pendo session ends immediately
  8. Switch accounts: consent setting is preserved per device

Checklist

  • Follow-up e2e test ticket created or not needed
  • Tested in dark mode
  • Tested in light mode
  • Test in landscape mode and/or tablet
  • A11y checked
  • Approve from product

🤖 Generated with Claude Code

Co-Authored-By: Claude noreply@anthropic.com

refs: MBL-19875
affects: Student, Teacher, Parent
release note: none

test plan: You'll need local canvas to test as of now.
Go to each section that uses a webview, and navigate around, while checking the following:
There must be no console warning saying "OneTrust would initialize."
The window.JS_ENV object should contain MOBILE_COOKIE_CONSENT with a boolean true value.
Close the client.
Set the mobile_consent passed-on value to “false”.
Do the same as previously, MOBILE_COOKIE_CONSENT should show a boolean false value, and the console warning should not be visible.
refs: MBL-19874
affects: Student, Teacher, Parent
release note: Added consent screen for anonymous analytics.

test plan: Use beta. Check the ticket. Enable the cookie consent feature flag.
1. Check if the dialog appears on the first app open after the ff was enabled.
2. Subsequent opens don't display the dialog.
3. The dialog is accessible via the Settings > Legal screen too.
# Conflicts:
#	libs/pandautils/src/test/java/com/instructure/pandautils/domain/usecase/session/GetAuthenticatedSessionUseCaseTest.kt
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Mar 31, 2026

🧪 Unit Test Results

❌ 📱 Parent App

  • Tests: 315 total, 2 failed, 0 skipped
  • Duration: 33.934s
  • Success Rate: 99%
❌ Failed Tests (2)
  • com.instructure.parentapp.login.routevalidator.RouteValidatorViewModelTest.Load route with QR login url
  • com.instructure.parentapp.features.settings.ParentSettingsBehaviourTest.Settings behaviour has the correct items

✅ 📱 Student App

  • Tests: 1210 total, 0 failed, 0 skipped
  • Duration: 0.000s
  • Success Rate: 100%

✅ 📱 Teacher App

  • Tests: 364 total, 0 failed, 0 skipped
  • Duration: 30.002s
  • Success Rate: 100%

✅ 🌅 Horizon

  • Tests: 779 total, 0 failed, 0 skipped
  • Duration: 37.533s
  • Success Rate: 100%

✅ 📦 Submodules

  • Tests: 3441 total, 0 failed, 0 skipped
  • Duration: 58.084s
  • Success Rate: 100%

📊 Summary

  • Total Tests: 6109
  • Failed: 2
  • Skipped: 0
  • Status: ❌ 2 test(s) failed

Last updated: Fri, 24 Apr 2026 14:55:27 GMT

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Mar 31, 2026

📊 Code Coverage Report

⚠️ Student

  • PR Coverage: 42.56%
  • Master Coverage: 42.61%
  • Delta: -0.05%

⚠️ Teacher

  • PR Coverage: 25.22%
  • Master Coverage: 25.26%
  • Delta: -0.04%

✅ Pandautils

  • PR Coverage: 24.04%
  • Master Coverage: 23.99%
  • Delta: +0.05%

📈 Overall Average

  • PR Coverage: 30.61%
  • Master Coverage: 30.62%
  • Delta: -0.01%

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Mar 31, 2026

Parent Install Page

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Mar 31, 2026

Teacher Install Page

Comment thread apps/teacher/src/main/java/com/instructure/teacher/utils/AppManager.kt Outdated
@hermannakos hermannakos requested a review from tamaskozmer April 7, 2026 13:10
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 7, 2026

Student Install Page

@kdeakinstructure kdeakinstructure self-requested a review April 23, 2026 21:57
Copy link
Copy Markdown
Collaborator Author

@hermannakos hermannakos left a comment

Choose a reason for hiding this comment

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

QA+1

Copy link
Copy Markdown
Contributor

@kdeakinstructure kdeakinstructure left a comment

Choose a reason for hiding this comment

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

  • With QR Login, the dialog won't be displayed even though it is the first login attempt after installing the apps.
  • In Teacher, when the user uses the "Student View" feature, the student app will be opened with the "Test Student" dummy user, but the dialog won't be displayed this time. (This might be intentional if we don't want to track this particular dummy user's activities).

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