GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||
GeezerVison is showing github.com — fix(dataverse): harden OAuth connection preflight by waleedlatif1 · Pull Request #7238 · simstudioai/sim Conversation
Collaborator
Summary
Type of Change
Testing
Checklist
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
|
There was an error while loading. Please reload this page.
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Greptile SummaryThe PR hardens Dataverse OAuth setup and reconnect preflight while preserving the canonical scopes required by legacy authorization.
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains.
|
| 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. |
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
Reviews (2): Last reviewed commit: "fix(dataverse): preserve legacy reconnec..." | Re-trigger Greptile
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem 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.
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.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
b447a24 to
c67bafb
Compare
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@cubic review |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
@waleedlatif1 I have started the AI code review. It will take a few minutes to complete. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem 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
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
c67bafb4
Deployed
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.