Commit 4e44b9c
Fix historical team data preservation
Problem:
- When participants were deleted from Firestore, their historical
team assignments were lost in subsequent snapshot collections
- This made historical analytics useless for deleted participants
Solution:
**Historical Data Preservation (collect_coder_analytics.py)**:
- get_historical_participant_data() now lists all snapshots in GCS
- Finds and uses the most recent snapshot as historical source
- merge_participant_data() preserves historical team assignments
- Creates incremental, append-only history across collections
- Re-enabled "Unassigned" filtering (only applies to new unknown users)
Process to Restore Data:
1. Ran one-time restoration script to backfill from good snapshot
2. Restored team data for 79 workspaces from 2026-01-15 17:03 snapshot
3. Uploaded corrected baseline to GCS
4. Future collections now build incrementally on corrected data
Results:
- Historical analytics now preserved even after Firestore deletions
- 98 workspaces with correct team assignments
- 7 remain Unassigned (new users, correctly filtered)
- Future collections maintain append-only history
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>1 parent f95cc0a commit 4e44b9c
1 file changed
+22
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
238 | 238 | | |
239 | 239 | | |
240 | 240 | | |
241 | | - | |
242 | 241 | | |
243 | | - | |
244 | | - | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
245 | 254 | | |
246 | 255 | | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
247 | 262 | | |
248 | 263 | | |
249 | 264 | | |
| |||
366 | 381 | | |
367 | 382 | | |
368 | 383 | | |
369 | | - | |
370 | | - | |
371 | | - | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
372 | 388 | | |
373 | 389 | | |
374 | 390 | | |
| |||
0 commit comments