You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Unlock conversations incorrectly locked by sync soft cap trigger #5899
PR #5896 fixed a bug where the sync endpoint (/v1/sync-local-files) incorrectly set should_lock = True when fair-use soft caps triggered. This caused unlimited (paid) users to have their conversations locked immediately upon exceeding the 2h daily soft cap via sync — bypassing the graduated enforcement system (WARNING → THROTTLE → RESTRICT).
The bug was introduced in PR #5878 and was live while FAIR_USE_ENABLED=true in production.
Task
Identify impacted conversations: Query Firestore for conversations where:
Migration executed via Cloud Run job (migration-unlock-soft-cap, us-central1).
Results
Metric
Count
Paid users unlocked
6
Basic users skipped
2
Conversations unlocked
649
Memories unlocked
17
Action items unlocked
26
Total items restored
692
Root cause & fix
Bug: PR Sync: fair-use gates with lock-on-exhaustion (v2, clean) #5878 incorrectly set should_lock = True when fair-use soft caps triggered in the sync endpoint, locking conversations for all users exceeding the 2h daily cap — regardless of subscription tier
cc @mdmohsin7 and @aaravgarg — thank you for reporting the locked conversations. The root cause has been identified and fixed in PR #5896, and all impacted paid users have been unlocked via the migration in PR #5901.
Root cause of v1 miss: The original Cloud Logging query used --limit=500. Two heavy users alone consumed 1,686 of those 500 returned lines, causing 61 other impacted UIDs to be missed entirely.
v2 fix: Re-scanned with --limit=10000 across both backend-sync and backend services for the full window (2026-03-16 to 2026-03-22).
Activity
beastoin commentedon Mar 22, 2026
Migration Script Ready
Script:
backend/scripts/unlock_soft_cap_locked.pyHow it works
#comments supported)unlimitedorpro) — skips free/basic userspayment.py:484-486upgrade flow)Usage
Impacted scope (from logs)
sync: soft caps triggeredonbackend-syncserviceby AI for @beastoin
Add migration script to unlock conversations locked by sync soft cap bug
Add admin endpoint to unlock user content for paid users only
Add admin endpoint POST /v1/admin/user/{uid}/unlock
Add migration script to unlock conversations locked by sync soft cap …
beastoin commentedon Mar 22, 2026
Resolved
Migration executed via Cloud Run job (
migration-unlock-soft-cap,us-central1).Results
Root cause & fix
should_lock = Truewhen fair-use soft caps triggered in the sync endpoint, locking conversations for all users exceeding the 2h daily cap — regardless of subscription tierAll acceptance criteria met:
by AI for @beastoin
beastoin commentedon Mar 22, 2026
cc @mdmohsin7 and @aaravgarg — thank you for reporting the locked conversations. The root cause has been identified and fixed in PR #5896, and all impacted paid users have been unlocked via the migration in PR #5901.
by AI for @beastoin
beastoin commentedon Mar 22, 2026
Migration results — redacted UIDs
Unlocked (6 paid users):
chTv...np1fa9F...dM2fu8J...OI3k6p0...RF2KlQ3...yD3Mpg1...2i2Skipped (2 basic users — not unlocked per policy):
Pzub...lf2zUJ1...Dy2Total: 692 items unlocked across 6 paid users.
@mdmohsin7 @aaravgarg — please review and confirm these match the reported users. Let us know if any users are still experiencing locked content.
by AI for @beastoin
beastoin commentedon Mar 22, 2026
Migration v2 — expanded scope (69 UIDs)
Root cause of v1 miss: The original Cloud Logging query used
--limit=500. Two heavy users alone consumed 1,686 of those 500 returned lines, causing 61 other impacted UIDs to be missed entirely.v2 fix: Re-scanned with
--limit=10000across bothbackend-syncandbackendservices for the full window (2026-03-16 to 2026-03-22).Results
v2 breakdown: 2,915 conversations + 80 memories + 102 action items = 3,097 total items unlocked.
Includes
u17Y...3F2(originally reported user): 109 conversations + 2 action items unlocked.All 69 impacted UIDs (redacted)
Unlocked (46 paid users with locked items):
0Iu9...u53fDTh...Ms2mZ1W...cu10NMW...PE3fu8J...OI3nzkg...wU224dR...xR2G19P...Yn1ouAX...Xp12PPm...hk2GpZe...Gt2RJAz...Du14XpM...DM2HghN...qD3RwUl...Cb25pdl...mY2hlUc...x13SFyJ...dg16fkK...Ff1jcav...rc2srjr...9c26Q6M...8G3jfpE...ZV2tdHw...6r16QMB...Ix1JpmM...Pw2u17Y...3F27K1B...e12k6p0...RF2ueBY...e52BZou...aw2ka0h...YR2vuKA...Jo1chTv...np1KlQ3...yD3vwaN...LD2CMlO...Fg2l9gF...Qj2wYPO...pr2cOKZ...RU2lN1K...Bk2yiMk...Sc2cSc3...go2LQaR...ns2DeoH...aY2Mpg1...2i2Already clean (7 paid users — no locked items found):
3Jfs...Cj1,5MqL...Es2,CnGf...c82,ELGH...ys2,hQqD...iQ2,JqJq...xF2,fa9F...dM2Skipped (16 basic users — not unlocked per policy):
bOFR...Q42,dLN7...bS2,dQfh...303,k1z8...qd2,LbDX...ar1,lqWC...142,Pzub...lf2,vjob...O53,wnRQ...X83,WWlX...A83,xdlJ...ZE2,Z8Ko...ah1,zP88...io1,zUJ1...Dy2,zw8m...8E2,zweZ...TH2@mdmohsin7 @aaravgarg — updated list. Please cross-reference with reported users and let us know if anyone is still experiencing locked content.
by AI for @beastoin
Add migration script to unlock conversations locked by sync soft cap bug
Add admin endpoint to unlock user content for paid users only
Add admin endpoint POST /v1/admin/user/{uid}/unlock
Add migration script to unlock conversations locked by sync soft cap …