figma-plugin icon indicating copy to clipboard operation
figma-plugin copied to clipboard

Error with Credentials when Recovering Un-pushed Changes on Separate Branches

Open keeganedwin opened this issue 2 years ago • 3 comments

Describe the bug This bug is NOT easily reproduced, but when multiple users are working on a shared repository using their individual Personal Access Tokens (PATs) as sync providers, an issue arises when one user (User X) makes changes on branch X but does not push them. If another user (User Y) opens the plugin and clicks “yes” to recover local changes, an error message stating “Error with Credentials” is displayed. This issue occurs consistently whenever one user attempts to recover local changes while the other is actively working. The error can only be resolved by adding their respective PATs.

Used-case: The users in talk are having to constantly deal with this issue and have no other workaround other than to enter their PAT every time they get kicked out of the repository.

Extra details to the conditions:

  1. Crash or Restart Scenario: The plugin occasionally crashes or requires a restart, triggering the “Recover Local Changes” notification. However, when selecting “Yes” to recover the changes, a credentials error occurs. The only way to proceed is by entering credentials. At this point, the GitHub integration becomes disabled, resulting in the loss of all changes.

  2. Individual GitHub Accounts: Both users utilize their personal GitHub access keys and accounts while working on the same Figma files within the repository, but on different branches.

  3. Limited Workspace Credentials: After selecting “Enter credentials” and then canceling the process, applying the stored GitHub settings resolves the error. However, the credentials model attempts to open GitHub using the last user’s credentials who edited the document. Consequently, the recovered local changes are not retained, and it appears as if working on a new file.

To Reproduce Steps to reproduce the behavior (not guaranteed):

  1. Two users should have access to one repo and work on one file
  2. Have User X make a change on the main branch, but not push to repo (whilst user Y is also active on the file with the plugin open)
  3. Have User Y then close the plugin/file, open it again and recover local changes
  4. See error

The same can be tried to reproduce the error by working in different branches and have User Y make change, then have User X force close the plugin/tab, open and recover local changes

Expected behavior Allow users to recover local changes and not have to enter their PAT every time another user works in the same repo on the same file.

Screenshots or Screencasts CleanShot 2023-08-29 at 18 56 37@2x

keeganedwin avatar Aug 30 '23 07:08 keeganedwin

We're running into this same issue. Do you have any steps on how to fix or workaround it?

cerupcat avatar Jan 16 '24 23:01 cerupcat