-
-
Notifications
You must be signed in to change notification settings - Fork 10.1k
fix(studio): refetch GitHub repositories after new install #39021
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(studio): refetch GitHub repositories after new install #39021
Conversation
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This pull request has been ignored for the connected project Preview Branches by Supabase. |
Studio E2E Results
Artifacts: https://github.com/supabase/supabase/actions/runs/18055278634 Last updated: Saturday 27, September, 2025 05:07:42 (UTC) |
|
||
const GITHUB_ICON = ( | ||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 98 96" className="w-6"> | ||
<title>GitHub icon</title> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
note
Svg must have a title in it (biome says)
const refetchGitHubAuthorizationAndRepositories = () => { | ||
setTimeout(() => { | ||
refetchGitHubAuthorization() | ||
refetchGitHubRepositories() | ||
}, 2000) // 2 second to delay to let github authorization and repositories to be updated | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
note:
Github api takes ~2s per testing to acknowledge changes, retrying the query after 2s allows the pop-up to update with the latest repositories without the need to interact / search over the pop-up.
const [isConfirmingRepoChange, setIsConfirmingRepoChange] = useState(false) | ||
const [repoComboBoxOpen, setRepoComboboxOpen] = useState(false) | ||
const isParentProject = !Boolean(selectedProject?.parent_project_ref) | ||
const isParentProject = !selectedProject?.parent_project_ref |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
note:
Unnecessary boolean.
branchName: val.branchName, | ||
}) | ||
} catch (error) { | ||
} catch { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
note:
Unused error
if (error) handleError(error) | ||
// [Alaister]: temp fix until we have a proper response type | ||
return (data as any).repositories | ||
return data.repositories |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
note
This is now properly typed.
if (closeCallback) { | ||
// Poll to check if window is closed | ||
const checkClosed = setInterval(() => { | ||
if (newWindow.closed) { | ||
clearInterval(checkClosed) | ||
closeCallback() | ||
} | ||
}, 500) // Check every 500ms | ||
|
||
// Add a timeout to prevent infinite polling | ||
setTimeout(() => { | ||
clearInterval(checkClosed) | ||
}, 300000) // 5 minutes timeout | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
note
This trick allow to trigger refetch when the pop-up is closed after installation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tested on preview
What kind of change does this PR introduce?