Skip to content

Conversation

sergeibbb
Copy link
Member

@sergeibbb sergeibbb commented Aug 29, 2024

Description

When you logout from GK Dev and then login back, all configured cloud integrations should become connected.

Checklist

  • I have followed the guidelines in the Contributing document
  • My changes follow the coding style of this project
  • My changes build without any errors or warnings
  • My changes have been formatted and linted
  • My changes include any required corresponding changes to the documentation (including CHANGELOG.md and README.md)
  • My changes have been rebased and squashed to the minimal number (typically 1) of relevant commits
  • My changes have a descriptive commit message with a short title, including a Fixes $XXX - or Closes #XXX - prefix to auto-close the issue that your PR addresses

sergeibbb added a commit that referenced this pull request Aug 29, 2024
@sergeibbb sergeibbb force-pushed the bug/GLVSC-631-jira-lost branch from 18b1092 to 4191a79 Compare August 29, 2024 17:19
@axosoft-ramint axosoft-ramint self-assigned this Aug 29, 2024

private onUserCheckedIn() {
void this.syncCloudIntegrations(false);
void this.syncCloudIntegrations(true);
Copy link
Contributor

@axosoft-ramint axosoft-ramint Aug 29, 2024

Choose a reason for hiding this comment

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

@sergeibbb This will cause check-ins to always force reconnection to providers, even when the user manually disconnects and disables them.

check-in is considered a passive sync case and should never force reconnections, because it happens automatically in the background every 12 hours (in my repro here, I can trigger it by refreshing the account view. Note that my github integration was reconnected even though I chose to disable it previously, which is undesirable behavior).

checkin-forces-reconnection

Instead, we should check the logout flow and ensure that integrations can be disconnected "softly" when a logout or some other passive sync case triggers the disconnect. Then those integrations would reconnect upon login even when forceConnect is false on syncCloudIntegrations.

Copy link
Member Author

Choose a reason for hiding this comment

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

fixed

@sergeibbb sergeibbb force-pushed the bug/GLVSC-631-jira-lost branch from 4191a79 to 35a877c Compare August 30, 2024 12:58
Copy link
Contributor

@axosoft-ramint axosoft-ramint left a comment

Choose a reason for hiding this comment

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

The side-effect of this reset is similar to the previous issue - by clearing the "connected" key, we lose context on manual disconnects the user did, so any integrations the user manually disabled are automatically reconnected when logging back in (which is unexpected).

To repro:

  • Go to remotes view and disconnect GitHub, then choose "disable and sign out"
  • Log out of your GitKraken account in the client
  • Log back in to your GitKraken account in the client
  • Notice that GitHub is automatically reconnected (should still be disconnected)

I think it's fine to just use this.disconnect here, but we may need a new flag to use (not currentSessionOnly, because setting that causes this.container.integrations.disconnected(this, this.key) not to fire). The flag would just ensure that we do not store "false" for the connected key of this integration in storage.

@axosoft-ramint
Copy link
Contributor

@sergeibbb Hope you can forgive me committing to your branch. Since we want this in the release next week, I went ahead and updated the PR: it is back to using disconnect({ silent: true }) with the added condition that using the silent flag causes us not to "remember" your disconnect, so that it automatically reconnects the next time you log in. Unlike reset, this does not clear any stored value you have for remembering disconnected state - it simply does not touch the storage.

@axosoft-ramint axosoft-ramint merged commit 10da1f6 into main Aug 30, 2024
2 checks passed
@axosoft-ramint axosoft-ramint deleted the bug/GLVSC-631-jira-lost branch August 30, 2024 20:28
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.

2 participants