Skip to content

fix: ensure individually_overridden is reliably cleared#283

Open
jmileham wants to merge 1 commit into
Betterment:mainfrom
jmileham:fix_individually_overridden_leakage
Open

fix: ensure individually_overridden is reliably cleared#283
jmileham wants to merge 1 commit into
Betterment:mainfrom
jmileham:fix_individually_overridden_leakage

Conversation

@jmileham

@jmileham jmileham commented May 4, 2026

Copy link
Copy Markdown
Member

individually_overridden was not being maintained as a trustworthy signal for "this assignment is currently a manual per-visitor override." Two related bugs caused it to persist stale true values after bulk operations:

  1. BulkReassignment's SQL UPDATE never included individually_overridden in its SET clause, leaving the flag true after bulk reassignment.

  2. ArbitraryAssignmentCreation#individual_override? had a stickiness term (assignment.individually_overridden || !bulk_assignment?) that carried the flag forward onto the result even when a bulk operation superseded an individually-overridden record via the ArbitraryAssignmentCreation path. With the BulkReassignment bug fixed, this stickiness has no legitimate purpose — the flag will now be correctly false on any record a bulk operation has touched, so the term simplifies to !bulk_assignment?.

A backfill migration corrects existing records where individually_overridden is true but context shows the last operation was not an individual override. The history of individual overrides is preserved in previous_assignments, though those records may themselves be tainted by these bugs.

@samandmoore this is some prework buggy data identified before I take a stab at making stale individual overrides time out.

@jonmauney is there any possible impact on downstream processing? I don't think this value (which had to my eye buggy values after some bulk operations) is exposed on any API or used in filtering, and I believe all A/B test analysis is performed based on client-generated events now, so this feels low risk, but let me know if anything feels like it might be depending on this!

@jmileham jmileham requested a review from a team as a code owner May 4, 2026 16:35
end
end

it "remains during a bulk assignment" do

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This seemed like "testing behavior that isn't part of the requirements" when I paged through the archived repository. I couldn't find any documented reason that this would be desirable behavior. It basically committed to what I think is a bug here.

UPDATE assignments
SET individually_overridden = false
WHERE individually_overridden = true
AND context IS DISTINCT FROM 'individually_overridden'

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I had an ephemeral test to validate that this migration behaved as expected, but it felt exotic to test a migration so I deleted it.

@jmileham jmileham force-pushed the fix_individually_overridden_leakage branch from 865b298 to e7c1d60 Compare May 4, 2026 16:41
…tions

individually_overridden was not being maintained as a trustworthy signal
for "this assignment is currently a manual per-visitor override." Two
related bugs caused it to persist stale true values after bulk operations:

1. BulkReassignment's SQL UPDATE never included individually_overridden in
   its SET clause, leaving the flag true after bulk reassignment.

2. ArbitraryAssignmentCreation#individual_override? had a stickiness term
   (assignment.individually_overridden || !bulk_assignment?) that carried
   the flag forward onto the result even when a bulk operation superseded
   an individually-overridden record via the ArbitraryAssignmentCreation
   path. With the BulkReassignment bug fixed, this stickiness has no
   legitimate purpose — the flag will now be correctly false on any record
   a bulk operation has touched, so the term simplifies to !bulk_assignment?.

A backfill migration corrects existing records where individually_overridden
is true but context shows the last operation was not an individual override.
The history of individual overrides is preserved in previous_assignments,
though those records may themselves be tainted by these bugs.
@jmileham jmileham force-pushed the fix_individually_overridden_leakage branch from e7c1d60 to 6d7bde1 Compare May 4, 2026 16:47
@jonmauney

jonmauney commented May 4, 2026

Copy link
Copy Markdown

@jmileham we're leaning on what I think is a server-side fired "splitAssigned" event (here), and it doesn't care about individually_overridden directly. That said, the old split reports code does automatically ignore individually_overriden as a context, which I assume is sourced from this boolean, but 1) this has been sunset and 2) i think this was a niche enough TT feature to where it probably didn't affect outcomes of tests. Beyond that, no usage of that column in ETL.

@jmileham

jmileham commented May 4, 2026

Copy link
Copy Markdown
Member Author

Thanks @jonmauney - I think I've found another data quality problem here where this was only ever set on supersession of a previous explicit assignment as well which also made it non-complete for "first time override" case, so I'm gonna add to this PR for that case as well, and backfill this column to a complete set of actual individual overrides

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.

2 participants