Skip to content

Conversation

@Paveltarno
Copy link
Contributor

@Paveltarno Paveltarno commented Feb 4, 2026

Note

Description

This PR implements the push synchronization logic for OAuth connectors, enabling the CLI to sync local connector configurations with the Base44 API. The implementation handles creating, updating, and removing connectors, as well as managing OAuth authorization flows and error cases like different-user conflicts.

Related Issue

None

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Refactoring (no functional changes)
  • Other (please describe):

Changes Made

  • Created push.ts module with pushConnectors() function that syncs local connector configs to the API
  • Implemented sync logic that compares local connectors with upstream and performs create/update/delete operations
  • Added ConnectorSyncResult interface to track sync outcomes (synced, removed, needs_oauth, error)
  • Handles OAuth redirect URLs and connection IDs for authorization flows
  • Detects and reports different_user conflicts when a connector is already linked to another account
  • Graceful error handling for both sync and remove operations
  • Updated connectorResource to use the new pushConnectors implementation (previously threw an error)
  • Added comprehensive test suite (208 lines) covering all sync scenarios including success cases, errors, OAuth flows, and conflict detection

Testing

  • I have tested these changes locally
  • I have added/updated tests as needed
  • All tests pass (npm test)

Checklist

  • My code follows the project's style guidelines
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation (if applicable)
  • My changes generate no new warnings
  • I have updated AGENTS.md if I made architectural changes

Additional Notes

The implementation follows the Resource pattern established for entities, functions, and agents. The push logic handles three main scenarios: syncing local connectors to the API, removing upstream connectors not present locally, and managing OAuth authorization flows when needed. Error handling ensures graceful degradation when individual operations fail.


🤖 Generated by Claude | 2026-02-04 23:47 UTC

Add pushConnectors function that:
- Syncs all local connectors via /sync endpoint
- Removes upstream-only connectors not in local config
- Returns typed results (synced, removed, needs_oauth, error)

Includes unit tests covering all scenarios.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@github-actions
Copy link
Contributor

github-actions bot commented Feb 4, 2026

🚀 Package Preview Available!


Install this PR's preview build with npm:

npm i @base44-preview/cli@0.0.28-pr.191.4923654

Prefer not to change any import paths? Install using npm alias so your code still imports base44:

npm i "base44@npm:@base44-preview/cli@0.0.28-pr.191.4923654"

Or add it to your package.json dependencies:

{
  "dependencies": {
    "base44": "npm:@base44-preview/cli@0.0.28-pr.191.4923654"
  }
}

Preview published to npm registry — try new features instantly!

@claude
Copy link

claude bot commented Feb 4, 2026

Code review

No issues found. Checked for bugs and CLAUDE.md compliance.

@kfirstri kfirstri moved this from Backlog to In progress in CLI Development Feb 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: In progress

Development

Successfully merging this pull request may close these issues.

1 participant