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

fix(friendshipper): fix initial repo clone from modal #385

Merged
merged 1 commit into from
Dec 16, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 12 additions & 16 deletions friendshipper/src/lib/components/oobe/WelcomeModal.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,6 @@
try {
await updateAppConfig(updatedAppConfig);
await emit('success', 'Preferences saved.');
await restart();
} catch (e) {
await emit('error', e);
}
Expand All @@ -151,26 +150,23 @@
const initiateRepoClone = async () => {
errorMessage = '';
try {
cloning = true;
await handleUpdateAppConfig();

// only clone if this is our first time through
if (!currentConfig.repoPath) {
cloning = true;
await cloneRepo({ url: repoUrl, path: cloneLocation });
await cloneRepo({ url: repoUrl, path: cloneLocation });
Copy link
Contributor

@chris-believer chris-believer Dec 16, 2024

Choose a reason for hiding this comment

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

Is pulling the repoPath check safe? If cloneLocation already exists, do we end up in the catch?

Copy link
Member Author

Choose a reason for hiding this comment

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

yep! it's an early out in the backend


// force update of repo status
message = 'Updating repo status...';
$repoStatus = await getRepoStatus(SkipDllCheck.False, AllowOfflineCommunication.False);
// force update of repo status
message = 'Updating repo status...';
$repoStatus = await getRepoStatus(SkipDllCheck.False, AllowOfflineCommunication.False);

// run initial fetch of DLLs - it may be worth moving this and the engine fetch
// to the clone endpoint on the backend
message = 'Performing initial fetch of DLLs...';
await forceDownloadDlls();
// run initial fetch of DLLs - it may be worth moving this and the engine fetch
// to the clone endpoint on the backend
message = 'Performing initial fetch of DLLs...';
await forceDownloadDlls();

// run initial fetch of Engine binaries
message = 'Performing initial fetch of Engine binaries...';
await forceDownloadEngine();
}
// run initial fetch of Engine binaries
message = 'Performing initial fetch of Engine binaries...';
await forceDownloadEngine();
} catch (e) {
const error = e as Error;
errorMessage = String(error.message);
Expand Down
Loading