Skip to content

Add connection identification to Account model to support multiple instances of same code host type #730

Description

@coderabbitai

Context

The Account model currently stores only the provider type (e.g., github or gitlab) without identifying which specific connection instance the account belongs to.

Problem

When config.connections contains multiple connections of the same type (e.g., GitHub Cloud and a self-hosted GitHub Enterprise instance), the permission syncer uses .find(connection => connection.type === 'github')?.url which always returns the first match—regardless of which instance the account actually belongs to.

Impact

  • Permission syncs may call the wrong API endpoint
  • Failed syncs for users with accounts on different instances
  • Potential for incorrect permission data or data corruption

Solution

Add a mechanism to uniquely identify connections and link accounts to their specific connection instance (e.g., connectionId field on the Account model).

References

This affects both GitHub and GitLab permission syncing in accountPermissionSyncer.ts.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions