GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix(dataverse): harden OAuth connection preflight by waleedlatif1 · Pull Request #7238 · simstudioai/sim

Conversation

@waleedlatif1

@waleedlatif1 waleedlatif1 commented Aug 28, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • preserve canonical legacy scopes in generic Dataverse OAuth authorization
  • fail Dataverse reconnects before draft creation when the environment binding cannot be trusted
  • surface invalid workflow environments and Better Auth link failures instead of reporting success

Type of Change

  • Bug fix

Testing

  • 28 targeted tests passing
  • bun run lint:check
  • bun run type-check
  • bun run apps/sim/scripts/check-block-registry.ts origin/staging
  • bun run check:audits

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

greptile-apps[bot] reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
@vercel

vercel Bot commented Aug 28, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
docs Skipped Skipped Aug 28, 2026 11:16pm

Request Review

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@greptile-apps

greptile-apps Bot commented Aug 28, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Greptile Summary

The PR hardens Dataverse OAuth setup and reconnect preflight while preserving the canonical scopes required by legacy authorization.

  • Supplies canonical Dataverse scopes to generic OAuth link requests.
  • Validates reconnect bindings before creating connection drafts.
  • Surfaces invalid workflow environments and Better Auth link failures.
  • Adds targeted coverage for authorization scopes, reconnect preconditions, invalid environments, and link errors.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Important Files Changed

Filename Overview
apps/sim/app/api/auth/oauth2/authorize/route.ts Passes provider-specific canonical scopes into generic OAuth account linking while preserving existing draft and callback behavior.
apps/sim/hooks/queries/oauth/microsoft-dataverse-connections.ts Centralizes reconnect preflight checks and converts Better Auth link failures into rejected mutations.
apps/sim/app/workspace/[workspaceId]/integrations/connected/[credentialId]/connected-credential-detail.tsx Runs the centralized Dataverse reconnect assertion before creating a credential draft.
apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/credential-selector/microsoft-dataverse-policy.ts Explicitly models invalid requested environments in the Dataverse credential policy.
apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/credential-selector/credential-selector.tsx Displays invalid-environment guidance independently of credential selection and suppresses inappropriate OAuth actions.

Sequence Diagram

sequenceDiagram
  actor User
  participant UI as Dataverse UI
  participant Preflight as Reconnect preflight
  participant Draft as Credential draft API
  participant OAuth as OAuth authorization
  participant BA as Better Auth

  User->>UI: Connect or reconnect Dataverse
  UI->>Preflight: Validate environment binding
  alt Binding cannot be trusted
    Preflight-->>UI: Surface validation error
  else Binding is valid
    Preflight->>Draft: Create connection draft
    Draft-->>UI: Return draft ID
    UI->>OAuth: Start authorization
    OAuth->>BA: Link account with required scopes
    alt Link creation fails
      BA-->>UI: Return surfaced error
    else Link created
      BA-->>User: Redirect to Microsoft consent
    end
  end
Loading

Reviews (2): Last reviewed commit: "fix(dataverse): preserve legacy reconnec..." | Re-trigger Greptile

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

cubic-dev-ai[bot]
cubic-dev-ai Bot reviewed Aug 28, 2026
View reviewed changes

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2 issues found across 8 files

Confidence score: 3/5

  • connected-credential-detail.tsx can throw during legacy Dataverse reconnection before reaching the desktop-capable path, blocking users from reconnecting that credential; skip the web-only preflight for legacy bindings while preserving the intended rejection cases.
  • credential-selector.tsx fails to mark a Dynamics workflow for update when an invalid non-empty environment URL exists before credential selection, allowing invalid configuration to persist; decouple the URL validation from the hasOAuthSelection gate.
Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/credential-selector/credential-selector.tsx">

<violation number="1" location="apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/credential-selector/credential-selector.tsx:216">
P2: When a Dynamics workflow contains an invalid non-empty environment URL before a credential is selected, this condition never makes `needsUpdate` true because the whole expression remains gated by `hasOAuthSelection`; the selector therefore does not surface the invalid environment. Evaluate `hasInvalidEnvironment` outside the credential-selection gate while keeping scope/account updates gated on a selected credential.</violation>
</file>

<file name="apps/sim/app/workspace/[workspaceId]/integrations/connected/[credentialId]/connected-credential-detail.tsx">

<violation number="1" location="apps/sim/app/workspace/[workspaceId]/integrations/connected/[credentialId]/connected-credential-detail.tsx:133">
P2: When a legacy Dataverse credential is reconnected in the desktop app, this preflight throws before reaching the generic desktop-capable branch below. Skip the web-only check for legacy bindings while still rejecting query failures and invalid bindings.</violation>
</file>

Reply with feedback, questions, or to request a fix.

Fix all with cubic | Re-trigger cubic

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread ...omponents/editor/components/sub-block/components/credential-selector/credential-selector.tsx Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread ...orkspace/[workspaceId]/integrations/connected/[credentialId]/connected-credential-detail.tsx Resolved

Uh oh!

There was an error while loading. Please reload this page.

waleedlatif1 added 2 commits August 28, 2026 16:15
@waleedlatif1
fix(dataverse): harden OAuth connection preflight
d13f9cc
@waleedlatif1
fix(dataverse): preserve legacy reconnect behavior
c67bafb
@waleedlatif1
waleedlatif1 force-pushed the codex/dynamics-release-review-7224 branch from b447a24 to c67bafb Compare August 28, 2026 23:16
@vercel
vercel Bot temporarily deployed to Preview August 28, 2026 23:16 Inactive
@waleedlatif1

waleedlatif1 commented Aug 28, 2026

Copy link
Copy Markdown
Collaborator Author

@greptile

greptile-apps[bot] reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@waleedlatif1

waleedlatif1 commented Aug 28, 2026

Copy link
Copy Markdown
Collaborator Author

@cubic review

cubic-dev-ai[bot] reacted with eyes emoji
All reactions
  • 👀 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@cubic-dev-ai

cubic-dev-ai Bot commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

@cubic review

@waleedlatif1 I have started the AI code review. It will take a few minutes to complete.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

cubic-dev-ai[bot]
cubic-dev-ai Bot reviewed Aug 28, 2026
View reviewed changes

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 8 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Re-trigger cubic

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@waleedlatif1 waleedlatif1 mentioned this pull request Aug 28, 2026
v0.8.16: aws lambda, dynamics 365, actorless run fixes, usage chart #7224
Merged
@waleedlatif1
waleedlatif1 merged commit 44a3e44 into staging Aug 28, 2026
27 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@waleedlatif1
waleedlatif1 deleted the codex/dynamics-release-review-7224 branch August 28, 2026 23:34

This branch was previously deployed

1 inactive deployment
Preview — c67bafb4 Deployed Aug 28, 2026 by vercel[bot]
View deployment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@cubic-dev-ai cubic-dev-ai[bot] cubic-dev-ai[bot] left review comments

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

1 participant

@waleedlatif1
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.