Skip to content

Conversation

@Devasy
Copy link
Owner

@Devasy Devasy commented Jan 28, 2026

Enhance the Splitwise integration by implementing asynchronous data fetching for user, friends, groups, and expenses. This improves performance and reduces blocking during API calls, optimizing the import functionality for serverless deployments. Additionally, update the environment configuration to include a critical FRONTEND_URL variable for OAuth.

Summary by CodeRabbit

Release Notes

  • New Features

    • Optimized Splitwise import performance with parallel data fetching and concurrent group processing for faster, more efficient imports.
  • Documentation

    • Updated deployment guide with new environment variable requirements and configuration guidance for concurrency limits.
    • Enhanced troubleshooting section with OAuth URL matching requirements.

✏️ Tip: You can customize this high-level summary in your review settings.

@Devasy Devasy requested a review from vrajpatelll as a code owner January 28, 2026 16:55
@netlify
Copy link

netlify bot commented Jan 28, 2026

Deploy Preview for split-but-wiser canceled.

Name Link
🔨 Latest commit 00d7055
🔍 Latest deploy log https://app.netlify.com/projects/split-but-wiser/deploys/697a3f91de0e08000846f017

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 28, 2026

Caution

Review failed

The pull request is closed.

Walkthrough

Introduces asynchronous and concurrent processing for Splitwise imports across the client and service layers. Adds async wrapper methods to the Splitwise client, refactors the import service with parallel group/expense fetching and per-expense processing logic. Updates deployment documentation with required environment variables and performance optimization guidance.

Changes

Cohort / File(s) Summary
Documentation
DEPLOYMENT.md
Adds FRONTEND_URL environment variable with OAuth callback note; introduces Performance Optimizations section detailing asyncio-based concurrency improvements (async thread wrapping, parallel fetches with semaphores, batch preview generation) and troubleshooting guidance for OAuth URL matching.
Client Integration Layer
backend/app/integrations/splitwise/client.py
Introduces four new async wrapper methods (get_current_user_async, get_friends_async, get_groups_async, get_expenses_async) that offload synchronous Splitwise API calls to worker threads using asyncio.to_thread.
Service Import Logic
backend/app/integrations/service.py
Refactors preview path with parallel async fetches; introduces new _process_single_expense() method handling per-expense transformation, group mapping, user share resolution, settlement creation, and error handling within a concurrency limiter. Existing _import_expenses() now orchestrates batch processing via semaphore-controlled concurrent invocations.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@Devasy Devasy merged commit 9f3655c into main Jan 28, 2026
11 of 12 checks passed
@Devasy Devasy deleted the optimize-import branch January 28, 2026 16:56
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