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

Remote backup location ID getting reset #347

Closed
GentlemanHal opened this issue Dec 14, 2022 · 0 comments
Closed

Remote backup location ID getting reset #347

GentlemanHal opened this issue Dec 14, 2022 · 0 comments
Assignees
Labels
bug Something isn't working as expected

Comments

@GentlemanHal
Copy link
Member

GentlemanHal commented Dec 14, 2022

Bug report

Nevergreen version?
v7.0.0+3503.814c359 Razzmatazz

What are you running on?
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36

Expected behaviour?
The ID should not get reset when importing.

Actual behaviour?
The ID gets reset when importing.

Steps to reproduce?

  1. Add remote location
  2. Select GitHub gist
  3. Don't enter an ID (which will create a new gist)
  4. Add location
  5. Export to the location
  6. This will set the ID
  7. Import from the location
  8. The ID will be reset back to blank

This is happening because the ID for new gists is only getting created after we export for the first time, as this is the action that creates the gist. This means that the configuration that is actually saved in the gist doesn't have an ID.

The ID is returned in the response from the first export and set in the local state. This is why importing from the gist without exporting to it again results in the ID getting reset to blank, as that is the ID saved in the gist.

This is likely to be a problem for GitLab snippets as well.

Possible fixes 🤔

Some potential ideas to fix, in no particular order!

  • Create new gists/snippets when adding the location so we always have an ID
    • The gist/snippet would just be empty until the user exported for the first time
  • Decouple creating the gist/snippet from uploading the configuration when exporting
    • Similar to the above option, but only done when the user triggers an export rather than on adding
  • If we are exporting to a new gist/snippet we could trigger another export to make sure the saved configuration contains the ID
  • Stop overwriting IDs when merging imported configuration in the reducer
@GentlemanHal GentlemanHal added the bug Something isn't working as expected label Dec 14, 2022
@GentlemanHal GentlemanHal self-assigned this Jun 2, 2023
GentlemanHal added a commit that referenced this issue Jun 2, 2023
GentlemanHal added a commit that referenced this issue Jun 8, 2023
Mostly to make the code easy to understand. It did however make the test a little more complicated as I needed to mock the store.

Refs: #347
GentlemanHal added a commit that referenced this issue Jul 31, 2023
The re-render from changing the redux state triggers before the navigation to the success page.
Meaning the location isn't found and the remote location page code triggered a navigation to the backup page cancelling the navigation to the success page.

Refs: #347
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working as expected
Projects
Status: Done
Development

No branches or pull requests

1 participant