Skip to content

Clarify what is_active means for a file-service connection #283

Description

@martsokha

Context

WorkspaceConnection.is_active gates connection actions: it's checked before manual sync, import, export, picker-token, and scheduled runs (e.g. connection_syncs.rs, connections.rs, the sync worker). For an object store this is clearly useful — set is_active = false to pause scheduled sync while keeping the config and credentials.

For a file-service connection (Google Drive, Dropbox, OneDrive, Box), the value is much weaker:

  • File services have no scheduled runs (their schedule row carries no cron; the scheduler only lists connections with schedule_cron IS NOT NULL). So "disable to pause automatic sync" — the main reason to disable an object store — does not apply.
  • Every file-service action is user-initiated (picker import, per-file export, picker-token). Disabling only blocks the user's own on-demand actions, which is nearly the same as "don't use it."
  • Disabling does not revoke or affect the stored OAuth tokens; token refresh happens only on use.

The question

What should is_active = false mean for a file-service connection? Options considered:

  1. Leave it as a uniform field (current). Harmless; still has a defensible admin use — a workspace admin turns a connection off for all members (blocks import/export through it) without deleting the OAuth grant. Consistent API across connection types.
  2. Ignore/hide it for file services. Stop gating on-demand file-service actions on is_active (or omit the toggle for file services), since it only blocks the user's own actions. Makes the field's meaning provider-dependent — arguably worse for API consistency.
  3. Give it real meaning. Make disabling actually do something distinct — refuse token refresh, mark the connection for reconnect, etc. More machinery for an unclear benefit.

Leaning toward (1): keep it uniform, and treat it as an admin-level "turn this connection off for everyone without losing tokens" switch — which is a real (if minor) use even for file services. This issue is to decide and document the intended semantics rather than leave it implicit.

Not blocking

No correctness bug — the current behavior (gate all actions on is_active) is safe. This is a semantics/clarity decision. Related: #277 (connectors), #282 (picker token + export).

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    serverAPI handlers, middleware, auth

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions