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

attempt to start, redirect to onboarding #720

Merged
merged 3 commits into from
Mar 13, 2024

Conversation

turbocrime
Copy link
Contributor

solves #712

@turbocrime turbocrime requested a review from grod220 March 12, 2024 18:24
@turbocrime turbocrime marked this pull request as ready for review March 12, 2024 18:25
Copy link
Contributor

@grod220 grod220 left a comment

Choose a reason for hiding this comment

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

I seem to be getting some strange loading artifacts (sometimes no UI, sometimes just loading bar).

Also with the exponential backoff, I suppose we are hoping it initializes after the wallet gets added with not too much wait? What about onboarding sending an initialization message (think we had that before?).

newmovie.mov

apps/extension/public/manifest.json Show resolved Hide resolved
apps/extension/src/listeners.ts Outdated Show resolved Hide resolved
@turbocrime turbocrime force-pushed the turbocrime/712-onboarding-hangs branch from 24134b4 to a1b36f4 Compare March 13, 2024 00:15
Copy link
Contributor Author

Choose a reason for hiding this comment

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

it seems like one of the root causes was that parameters were not yet present in idb - imo either minifront should handle that condition, or services init should ensure they're present, but this was a simpler fix

@turbocrime
Copy link
Contributor Author

I seem to be getting some strange loading artifacts (sometimes no UI, sometimes just loading bar).

i wasn't able to achieve some of the UI states you showed in this video, but i did make the first load reliable.

Also with the exponential backoff, I suppose we are hoping it initializes after the wallet gets added with not too much wait? What about onboarding sending an initialization message (think we had that before?).

now using both.

@turbocrime turbocrime force-pushed the turbocrime/712-onboarding-hangs branch from 15a21b9 to 8e88eb5 Compare March 13, 2024 19:09
Comment on lines 87 to 88
const params = await this.querier.app.appParams();
if (!params.sctParams?.epochDuration) throw new Error('Epoch duration unknown');
Copy link
Contributor Author

Choose a reason for hiding this comment

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

pairing with @jessepinho i think it's not appropriate to get epoch duration here but that should be a separate issue

Copy link
Contributor

@jessepinho jessepinho left a comment

Choose a reason for hiding this comment

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

LGTM! One small Q but feel free to merge if I'm missing something

return { parameters };
if (parameters) return { parameters };
for await (const update of subscription)
return { parameters: AppParameters.fromJson(update.value) };
Copy link
Contributor

Choose a reason for hiding this comment

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

Ah, nice — does this prevent the error that often shows up after clearing the cache that says something about not being able to find AppParameters? If so, this is a great solution!

Comment on lines -19 to -23

if (!wallets.length) {
await chrome.tabs.create({ url: chrome.runtime.getURL(`page.html`) });
window.close();
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Are we OK with not checking for wallets anymore? Don't we want to check await needsLogin() and await needsOnboard()?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

the login page cascades to needsOnboard

@turbocrime turbocrime force-pushed the turbocrime/712-onboarding-hangs branch from 8e88eb5 to 26b9c97 Compare March 13, 2024 20:44
@turbocrime turbocrime merged commit ec0789b into main Mar 13, 2024
1 check passed
@turbocrime turbocrime deleted the turbocrime/712-onboarding-hangs branch March 13, 2024 20:44
Comment on lines +5 to +18
export const needsLogin = async (): Promise<Response | undefined> => {
const password = await sessionExtStorage.get('passwordKey');
if (password) return;

return redirect(PopupPath.LOGIN);
};

export const needsOnboard = async () => {
const wallets = await localExtStorage.get('wallets');
if (wallets.length) return;

void chrome.runtime.openOptionsPage();
window.close();
};
Copy link
Contributor

Choose a reason for hiding this comment

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

These need to return null right? Otherwise there will be that extension update error we saw while pairing.

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.

3 participants