-
Notifications
You must be signed in to change notification settings - Fork 1.4k
fix: task export only works every other time #4648
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request fixes an issue where task integrations were not loaded, causing task exports to fail. The change introduces logic in ActionItemsPage to proactively load the TaskIntegrationProvider state on initialization. This is a good fix that directly addresses the problem. I've added one comment regarding a potential race condition in the data loading logic to make it more robust.
|
@krushnarout Quick nudge: tests/demo evidence is required before review. Please add test output or a short screenshot/video, then flip this back to ready. Thanks. by AI for @beastoin |
…onnections Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
What was fixedProblem: Task auto-export to external apps (Todoist, Asana, Google Tasks, ClickUp) only worked every other time — create 2 items, only 1 exports; create 4, only 2 export. Root cause: The backend auto-sync runs in daemon threads using Fix (2 files):
DemoBefore (every other export fails): ScreenRecording_02-11-2026.09-11-15_1.MOVAfter (all exports work consistently): ScreenRecording_02-11-2026.09-17-37_1.MOV |
Summary
Root cause
The backend auto-sync spawns daemon threads that each call
asyncio.run(), creating a new event loop per call. But all threads shared a globalhttpx.AsyncClient(viaget_http_client()). When the first thread's event loop closes, the client's connections become stale. The next thread reuses the same client with dead connections → request fails. Then the stale connections get cleaned up → next call works again. This produces the alternating success/failure pattern.Fix
task_sync.py: Create a freshhttpx.AsyncClient(viaasync with) per auto-sync call instead of reusing the global singletontask_integrations.py: Add optionalclientparameter to_create_task_internal,ensure_valid_oauth_token, andrefresh_oauth_tokenso the fresh client is threaded through the entire call chainclient, so the global is used as before)Test plan
🤖 Generated with Claude Code