PIR: Add optOutFormSubmittedDate to Web dashboard contract#8603
Merged
Conversation
Implements the Android side of the cross-platform "opt-out submitted" unification design. Adds a persisted optOutFormSubmittedDate column on OptOutJobRecordEntity, stamps it on first form-submission success (non-email and email-confirming brokers), and propagates it to the Web UI per-match payload. Child broker matches inherit the most recent parent-broker timestamp. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Broker.parent stores the parent's URL (matching production broker JSON configs), while opt-out records reference brokers by name. The previous map was keyed by name, so the child-broker propagation lookup silently missed in production. Re-key by URL via the active-broker map. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Contributor
Author
|
Opening this and closing #8406 |
8 tasks
0nko
approved these changes
May 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Task/Issue URL: https://app.asana.com/1/137249556945/project/1209121419454298/task/1214253991604420?focus=true
Description
Implements the Android side of the cross-platform "opt-out submitted" unification design. Adds a new
optOutFormSubmittedDatefield to the per-match payload sent to the PIR Web dashboard so the Activity card can count submissions made by us, not broker acknowledgments.optOutFormSubmittedDateon a new nullable column onOptOutJobRecordEntity(DB v16, destructive migration via existing fallback).JobRecordUpdater.updateOptOutRequestedJobRecordUpdater.markOptOutAsWaitingForEmailConfirmation(the form-submission moment for that flow)DashboardExtractedProfileResultandPirWebMessageResponse.ScanResult(in seconds, like the sibling timestamps).broker.parent != null) inherit the most recentoptOutFormSubmittedDateacross any opt-out on the parent broker per design note [3]. Mirror sites copy the value from the parent broker's match.Steps to test this PR
Form submission stamping (non-email broker)
pir_optout_job_recordtable) thatoptOutFormSubmittedDateandoptOutRequestedDateare equal and non-null.optOutFormSubmittedDateis unchanged whileoptOutRequestedDateupdates.Form submission stamping (email-confirming broker)
optOutFormSubmittedDateis set as soon as the form is submitted (status = PENDING_EMAIL_CONFIRMATION), before email confirmation completes.optOutRequestedDateis set later thanoptOutFormSubmittedDate.Web contract
initialScanStatus/maintenanceScanStatusresponse payloads and confirm eachScanResultincludesoptOutFormSubmittedDate(Unix seconds, nullable).Child broker propagation
optOutFormSubmittedDate, even when the child profile doesn't strictly match the parent.UI changes
N/A — native↔WebView contract change only; no native UI changes.
Note
Medium Risk
Adds a new persisted timestamp to the opt-out job record (Room DB v16) and threads it through scheduling and dashboard state into the WebView JS contract; errors in migration or propagation logic could affect opt-out status reporting.
Overview
Adds a new
optOutFormSubmittedDatetimestamp to PIR opt-out reporting. A nullableoptOutFormSubmittedDatecolumn is added topir_optout_job_record(Room schema v16 w/ auto-migration) and mapped throughOptOutJobRecordEntity�OptOutJobRecord.JobRecordUpdaternow stampsoptOutFormSubmittedDateInMillison the first successful form submission (both directREQUESTEDflows andPENDING_EMAIL_CONFIRMATIONflows) and preserves the original value on retries. The dashboard state and WebView message payloads (initialScanStatusandmaintenanceScanStatus) now includeoptOutFormSubmittedDate(seconds, nullable), with child brokers inheriting the most recent parent-broker submission timestamp and mirror-site results copying the parent match.Tests are updated/added to validate the new field in message payloads, retry preservation behavior, and parent�child propagation rules.
Reviewed by Cursor Bugbot for commit c1b4eb9. Bugbot is set up for automated code reviews on this repo. Configure here.