-
Notifications
You must be signed in to change notification settings - Fork 355
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
WIP: Live 1792: Synchronized onboarding logic #214
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
|
Codecov Report
@@ Coverage Diff @@
## develop #214 +/- ##
============================================
+ Coverage 56.23% 70.81% +14.58%
============================================
Files 471 63 -408
Lines 20945 4067 -16878
Branches 5322 762 -4560
============================================
- Hits 11778 2880 -8898
+ Misses 9115 1178 -7937
+ Partials 52 9 -43
Flags with carried forward coverage won't be shown. Click here to find out more. Continue to review full report at Codecov.
|
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.
really cool to see this happening 👏
setStepIndex(7); | ||
break; | ||
default: | ||
setStepIndex(0); |
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.
there may be a way to simplify this with an array containing all the steps that you are currently switch()ing on.
const steps = [OnboardingStep.WelcomeScreen, ...]
const stepIndex = steps.indexOf(onboardingState?.currentOnboardingStep) + 1
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.
Yeah, definitely I'll try to make something simpler like this ! Right now for this screen it was to demo and show that the polling mechanism was working ;)
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.
+1
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.
Looking good. Just a few comments on code clarity / style.
libs/ledger-live-common/src/onboarding/hooks/useOnboardingStatePolling.ts
Outdated
Show resolved
Hide resolved
libs/ledger-live-common/src/onboarding/hooks/useOnboardingStatePolling.ts
Outdated
Show resolved
Hide resolved
libs/ledger-live-common/src/onboarding/hooks/useOnboardingStatePolling.ts
Outdated
Show resolved
Hide resolved
FYI: i will move the |
b256386
to
8154ab1
Compare
- polling device status and retry strategy - typed navigator for sync onboarding
It throws if an error occurred
…or observable And follows rxjs naming convention with a "$" suffix for Observables
cbd4501
to
9296d68
Compare
6de3923
to
e75cc11
Compare
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.
lgtm, so many tests, cleanup the logs and such though
@@ -109,7 +109,7 @@ platform :ios do | |||
|
|||
build_number = latest_testflight_build_number( | |||
version: trim_version_number(package["version"]), | |||
app_identifier: MY_APP_BUNDLE_ID | |||
app_identifier: "com.ledger.live" |
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.
Why is this here?
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.
it was a fixed to be able to build iOS that Valentin told me to try -> as this PR won't be merged, i did not put any comment on it. But Valentin merged this fix on develop yesterday ;)
from(getVersion(t)), | ||
).toPromise(); | ||
} catch (_) { | ||
// Silently swwallowing error, we only want to trigger the native ble pairing step |
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.
ww
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.
🙈 sorry forgot about this feedback - i'm thinking on working on the BLE part in a new PR as my next step (after merging stuff from live-common in a new/clean PR)
route.params?.onDone?.(device); | ||
// To avoid passing a onDone function param that is not serializable | ||
if (route.params?.onDoneNavigateTo === ScreenName.SyncOnboardingWelcome) { | ||
console.log("PairDevices: 🦮 navigate directly to SyncOnboarding"); |
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.
🪓
// it does not matter. | ||
// So as long as the device is not onboarded, the LLM will ask for a pairing. | ||
useEffect(() => { | ||
console.log("SyncOnboarding: navigate to pairDevices"); |
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.
🪓
setStepIndex(7); | ||
break; | ||
default: | ||
setStepIndex(0); |
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.
+1
❓ Context
This PR is WIP (don't bother with all the
console.log
) but ready for comments and feedbacks👷The main features are:
🕵️♂️ Compared to the previous PR on the live-common and ledger-live-mobile, this feature fixed (parts, some are still WIP) comments from this PR and:
timer
that would push for a request every period time, without waiting for the previous request -> now customObservable
is created with arepeat
new Observable
way has been chosen, compared to just used rxjs operators etc., with a system to not delay for the first run (and then repeat with a delay of X ms) becauserepeat({ delay: (count) => count > 0 ? timer(periodMs) : timer(0) })
does not exist in rxjs v6allowedError
and afatalError
is returned from the polling mechanism and the hook so the app (LLM and LLD) are notified when an error occurred✅ Checklist
📸 Demo
Will record a new demo video after on slack
🚀 Expectations to reach
Please make sure you follow these Important Steps.
Pull Requests must pass the CI and be internally validated in order to be merged.