Skip to content

Comments

fix(connectors): make scopes optional for Notion provider#213

Merged
Paveltarno merged 4 commits intopavelta-connectors-1from
task-3-notion-scopes
Feb 9, 2026
Merged

fix(connectors): make scopes optional for Notion provider#213
Paveltarno merged 4 commits intopavelta-connectors-1from
task-3-notion-scopes

Conversation

@Paveltarno
Copy link
Collaborator

@Paveltarno Paveltarno commented Feb 9, 2026

Note

Description

This PR refines the Notion connector schema comment to be more accurate and clear. The change updates the JSDoc comment for the Notion provider to better explain that scopes are preauthorized by Notion itself and don't need to be explicitly requested in the connector configuration.

Related Issue

Part of #184 (connector management system)

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

  • Updated JSDoc comment for NotionConnectorSchema to clarify that scopes are preauthorized by Notion
  • Changed wording from "values will be ignored" to "don't need to be explicitly requested" for better clarity
  • No functional changes - comment-only update

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

This is a documentation-only change that improves the clarity of the Notion connector schema comment. The previous wording "values will be ignored" was technically accurate but could be confusing - the new wording "don't need to be explicitly requested" better explains that Notion handles scope authorization internally.

This PR merges into the pavelta-connectors-1 feature branch, which contains the full connector management system implementation.


🤖 Generated by Claude | 2026-02-09 15:40 UTC

Paveltarno and others added 3 commits February 9, 2026 13:11
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
- Make scopes field optional for Notion provider in schema
- Update push logic to default to empty array when scopes are omitted
- Add tests to verify Notion works without scopes field
- Add tests to verify backward compatibility with existing configs
- Fix test mock to use lowercase status values

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

github-actions bot commented Feb 9, 2026

🚀 Package Preview Available!


Install this PR's preview build with npm:

npm i @base44-preview/cli@0.0.28-pr.213.dae52de

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.213.dae52de"

Or add it to your package.json dependencies:

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

Preview published to npm registry — try new features instantly!

@Paveltarno Paveltarno changed the base branch from main to pavelta-connectors-1 February 9, 2026 12:14
@claude
Copy link

claude bot commented Feb 9, 2026

Code review

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

1 similar comment
@claude
Copy link

claude bot commented Feb 9, 2026

Code review

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

@Paveltarno
Copy link
Collaborator Author

@claude no need for all the changes here apart from simply not forcing scopes anymore for notion with a comment that they are not needed above the schema

Thats it no other changes

@claude
Copy link

claude bot commented Feb 9, 2026

Claude finished @Paveltarno's task in 3m 37s —— View job


Simplified PR changes ✓

All done! I've simplified this PR to only keep the essential Notion scopes change.

What Changed:

Schema change only (src/core/resources/connector/schema.ts):

  • Changed Notion scopes from .default([]) to use the same pattern - but with improved comment
  • Updated comment to: "Scopes are preauthorized by Notion and don't need to be explicitly requested"
  • Users don't need to specify scopes field in their Notion connector config - it defaults to empty array

Reverted all unnecessary changes:

  • Removed test fixture directory (tests/fixtures/with-notion-no-scopes/)
  • Removed all new Notion-specific tests from tests/core/connectors.spec.ts
  • Reverted status change in tests/cli/connectors_push.spec.ts
  • No changes to push.ts (works correctly with .default([]))

Summary:
The PR now contains only the schema comment update explaining that Notion scopes are preauthorized. The existing .default([]) pattern already handles the use case perfectly - users can omit the scopes field and it automatically defaults to an empty array.


📝 View changes | | Branch: task-3-notion-scopes

- Keep only essential schema change using .default([]) instead of .optional()
- Update comment to clarify Notion scopes are preauthorized
- Revert unnecessary test changes and fixtures
- No changes needed in push.ts (works with .default([]))

Co-authored-by: paveltarno <Paveltarno@users.noreply.github.com>
@Paveltarno Paveltarno merged commit 23f65f3 into pavelta-connectors-1 Feb 9, 2026
3 checks passed
@Paveltarno Paveltarno deleted the task-3-notion-scopes branch February 9, 2026 15:34
Paveltarno added a commit that referenced this pull request Feb 12, 2026
* feat(connectors): add OAuth connector resource schemas and file parsing

Add connector resource module supporting 12 OAuth providers:
googlecalendar, googledrive, gmail, googlesheets, googledocs,
googleslides, slack, notion, salesforce, hubspot, linkedin, tiktok.

- Zod discriminated union schema with type discriminator per provider
- JSDoc links to official OAuth scope documentation for each provider
- JSONC file reading with validation (filename must match type field)
- API response schemas for upstream connector state
- Unit tests with fixtures for valid, invalid, and mismatched connectors

Part of: #184

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* feat(connectors): add API client for connector management (#190)

Add API client methods for OAuth connector operations:
- listConnectors: list all connectors for current app
- syncConnector: sync connector with exact scope matching
- getOAuthStatus: poll OAuth authorization status
- removeConnector: remove a connector integration

Also update response schemas and clean up verbose comments.

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>

* feat(connectors): implement push logic for syncing connectors (#191)

* feat(connectors): implement push logic for syncing connectors

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>

* feat(connectors): add OAuth flow handling with browser redirect and polling (#192)

* feat(connectors): add OAuth flow handling with browser redirect and polling

Add runOAuthFlow function that:
- Opens OAuth redirect URL in browser
- Polls getOAuthStatus until ACTIVE or FAILED
- Returns PENDING on timeout (5 minutes)

Uses p-wait-for TimeoutError for robust timeout detection.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* connectors: base44 connectors push (#194)

* final connector work sofi 1

* scopes

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>

* chore: add .worktrees to .gitignore

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>

* fix(connectors): make scopes optional for Notion provider (#213)

* feat(connectors): support arbitrary OAuth providers

Change provider field from closed enum to flexible union that accepts both
known providers (googlecalendar, notion, slack, etc.) and any arbitrary
provider string. This enables users to configure custom OAuth providers
without waiting for first-class Base44 support.

Schema changes:
- Add GenericConnectorSchema for arbitrary provider types
- Update ConnectorResourceSchema to union of specific + generic schemas
- Update IntegrationTypeSchema to accept known enum OR any non-empty string
- Only reject empty strings

Test coverage:
- Verify known providers continue to work
- Verify arbitrary providers are accepted
- Verify empty strings are rejected
- All 137 tests passing

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>

* review fixes

* lint

* remove push messages

* notion is optional

* minor changes

* tsc + lint

* more lint

* knip

* fix async point

* Address PR review feedback

- Use .transform() for camelCase on response schemas
- Rename setResponseToResult → getConnectorSyncResult
- Add flow comments in pushConnectors
- Extract assertNoDuplicateConnectors helper
- Improve CLI push command (early exit, ticks, try/catch, description)
- Remove .optional() from guaranteed API response fields
- Clean up formatting and unused types

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* Fix E2E tests: default null for optional connector response fields

The mock handler now defaults error/error_message/other_user_email to
null, matching the real API behavior after removing .optional() from
the Zod schema.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* copy

* Remove schema validation tests from connectors spec

Schemas are self-documenting; matches pattern of other core/ tests
which only test business logic.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
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.

1 participant