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

Saving the entire URL on the Repository Widgets #401

Merged
merged 3 commits into from
Jun 10, 2024

Conversation

guimafelipe
Copy link
Contributor

@guimafelipe guimafelipe commented Jun 6, 2024

Summary of the pull request

When the widget was being saved, we changed the data to include only the main URL, without the query. This created a bug when if the user customized the widget but cancelled the process, the widget would lose track of its query because it was not being saved on the ConfigurationData. With this PR, we never change the actual URL that the user used as input, keeping it consistent.

This PR also fixes the issue where we could save widgets with invalid URLs. This would happen if the user submit a URL, change it for some reason, and then save the widget. As the save action also gets data (important to get the last title input for example), we need to correct it to the URL we are sure is correct.

References and relevant issues

Detailed description of the pull request / Additional comments

Validation steps performed

PR checklist

@guimafelipe guimafelipe requested review from dkbennett and krschau June 6, 2024 22:13
@@ -46,6 +46,19 @@ public string GetUnescapedIssueQuery()
return Uri.UnescapeDataString(GetIssueQuery()).Replace('+', ' ');
}

// If the user changed the URL after clicking submit and clicked
// saved just after, we change it back to what was before to not corrupt our saved data.
private void CorrectUrl()
Copy link
Contributor

Choose a reason for hiding this comment

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

The comments sound like a race-condition. What is happening between "Submit" and "Save"?

Copy link
Collaborator

Choose a reason for hiding this comment

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

They are separate buttons in the widget, so unlikely that the user could click them both fast enough to cause an issue.

@guimafelipe guimafelipe merged commit 6072955 into main Jun 10, 2024
4 checks passed
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.

Issue widget keep forgetting query
3 participants