Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(editor): Prevent duplicate creation of credential for OAuth2 #7163

Conversation

cstuncsik
Copy link
Contributor

@cstuncsik cstuncsik commented Sep 13, 2023

This PR solves the issue reported in this ticket.

Basically when trying to connect OAuth2 credentials, n8n would create the credential twice, possibly causing transaction issues.

This PR prevents n8n from firing a duplicate creation request, effectively fixing the bug about duplicate creation.

@github-actions
Copy link
Contributor

Great PR! Please pay attention to the following items before merging:

Files matching packages/**:

  • If fixing bug, added test to cover scenario.
  • If addressing forum or Github issue, added link to description.

Files matching **/*.vue:

  • Used composition API for all new components.
  • Added component or unit tests to cover functionality.

Files matching packages/editor-ui/**/*.vue:

  • Added E2E if adding new features.
  • Used design system tokens (colors, spacings...) where possible.

Make sure to check off this list before asking for review.

@n8n-assistant n8n-assistant bot added n8n team Authored by the n8n team ui Enhancement in /editor-ui or /design-system labels Sep 13, 2023
@codecov
Copy link

codecov bot commented Sep 13, 2023

Codecov Report

Patch coverage has no change and project coverage change: -0.01% ⚠️

Comparison is base (34ebffe) 32.40% compared to head (13e5b83) 32.40%.
Report is 2 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #7163      +/-   ##
==========================================
- Coverage   32.40%   32.40%   -0.01%     
==========================================
  Files        3276     3276              
  Lines      198005   198004       -1     
  Branches    21652    21653       +1     
==========================================
- Hits        64162    64157       -5     
- Misses     132782   132786       +4     
  Partials     1061     1061              
Files Changed Coverage Δ
...src/components/CredentialEdit/GoogleAuthButton.vue 0.00% <ø> (ø)
...r-ui/src/components/CredentialEdit/OauthButton.vue 0.00% <0.00%> (ø)

... and 3 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@cypress
Copy link

cypress bot commented Sep 13, 2023

Passing run #2159 ↗︎

0 239 0 0 Flakiness 0

Details:

🌳 pay-825-click-to-connect-for-google-sheets-does-not-work-when-cred 🖥️ browse...
Project: n8n Commit: 13e5b83caf
Status: Passed Duration: 07:30 💡
Started: Sep 13, 2023 3:15 PM Ended: Sep 13, 2023 3:22 PM

This comment has been generated by cypress-bot as a result of this project's GitHub integration settings.

@github-actions
Copy link
Contributor

✅ All Cypress E2E specs passed

@krynble krynble changed the title fix(editor): Prevent double click event on credential oauth button fix(editor): Prevent duplicate creation of credential when clicking connect for OAuth2 Sep 13, 2023
@krynble krynble changed the title fix(editor): Prevent duplicate creation of credential when clicking connect for OAuth2 fix(editor): Prevent duplicate creation of credential for OAuth2 Sep 13, 2023
@krynble krynble merged commit 07a6417 into master Sep 13, 2023
21 checks passed
@krynble krynble deleted the pay-825-click-to-connect-for-google-sheets-does-not-work-when-cred branch September 13, 2023 15:28
netroy pushed a commit that referenced this pull request Sep 14, 2023
This PR solves the issue reported in [this
ticket](https://linear.app/n8n/issue/PAY-825/click-to-connect-for-google-sheets-does-not-work-when-cred-is-not).

Basically when trying to connect OAuth2 credentials, n8n would create
the credential twice, possibly causing transaction issues.

This PR prevents n8n from firing a duplicate creation request,
effectively fixing the bug about duplicate creation.
@github-actions github-actions bot mentioned this pull request Sep 14, 2023
netroy added a commit that referenced this pull request Sep 14, 2023
## [1.7.1](https://github.com/n8n-io/n8n/compare/[email protected]@1.7.1)
(2023-09-14)


### Bug Fixes

* **editor:** Prevent duplicate creation of credential for OAuth2
([#7163](#7163))
([f6d7ffe](f6d7ffe))

Co-authored-by: netroy <[email protected]>
@janober
Copy link
Member

janober commented Sep 14, 2023

Got released with [email protected]

@github-actions github-actions bot mentioned this pull request Sep 20, 2023
krynble added a commit that referenced this pull request Sep 20, 2023
# [1.8.0](https://github.com/n8n-io/n8n/compare/[email protected]@1.8.0)
(2023-09-20)


### Bug Fixes

* **core:** Make parsing of content-type and content-disposition headers
more flexible ([#7217](#7217))
([d41546b](d41546b)),
closes [#7149](#7149)
* **core:** Resolve domains to IPv4 first
([#7206](#7206))
([e9ce531](e9ce531))
* **editor:** Add ssh key type selection to source control settings when
regenerating key ([#7172](#7172))
([54bf66d](54bf66d))
* **editor:** No need to add click emitting click events, VUE delegates
the handler to the root element of the component
([#7182](#7182))
([3c055e4](3c055e4))
* **editor:** Prevent duplicate creation of credential for OAuth2
([#7163](#7163))
([07a6417](07a6417))
* **editor:** Testing flaky resource mapper feature in e2e tests
([#7165](#7165))
([aaf87c3](aaf87c3))
* **HTML Node:** Add pairedItem support for 'Convert to HTML Table'
operation ([#7196](#7196))
([6bc477b](6bc477b))
* **HTTP Request Node:** Decrease default timeout to 5min
([#7177](#7177))
([321780d](321780d))
* **seven Node:** Rename sms77 to seven, fix credentials test
([#7180](#7180))
([cf776b8](cf776b8))
* **X (Formerly Twitter) Node:** Rename Twitter to X (keep Twitter
alias) ([#7179](#7179))
([d317e09](d317e09))


### Features

* **core:** Add command to trigger license refresh on workers
([#7184](#7184))
([9f797b9](9f797b9))
* **core:** Add rsa option to ssh key generation
([#7154](#7154))
([fdac2c8](fdac2c8))
* **Linear Node:** Add support for OAuth2
([#7201](#7201))
([12a3168](12a3168))
* **Microsoft Outlook Node:** Node overhaul
([#4449](#4449))
([556a613](556a613))
* **Set Node:** Overhaul
([#6348](#6348))
([3a47455](3a47455))

Co-authored-by: krynble <[email protected]>
easydigi pushed a commit to easydigi/n8n that referenced this pull request Sep 22, 2023
(2023-09-14)

* **editor:** Prevent duplicate creation of credential for OAuth2
([n8n-io#7163](n8n-io#7163))
([f6d7ffe](n8n-io@f6d7ffe))

Co-authored-by: netroy <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
n8n team Authored by the n8n team Released ui Enhancement in /editor-ui or /design-system
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants