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

Handle radio connect/ reconnect error scenarios #281

Merged
merged 24 commits into from
Aug 6, 2024
Merged

Conversation

microbit-grace
Copy link

@microbit-grace microbit-grace commented Aug 1, 2024

Task: https://microbit-global.monday.com/boards/1125389526/pulses/1575488964

Expected behaviour: Error connection cases logic https://paper.dropbox.com/doc/Reconnect-scenarios-copy--CTKwX5AyHNMod6Uq0Qosp8ZtAg-RWeX90ac5YQ9erncFZmWN can be used as reference

EDITED
Also implemented bluetooth connection fail dialog since there were conflicting changes
https://microbit-global.monday.com/boards/1125389526/pulses/1576736316

Other minor changes

  • Includes a small fix in logic in Add Data page so that data can be visible without connecting
  • For radio connection dev purposes, when locally developing, a skip button is visible for micro:bit 1 and the device Id is stored in the local storage.
  • Close start over session warning dialog when new session is selected

Copy link

github-actions bot commented Aug 1, 2024

Preview build will be at
https://review-ml.microbit.org/radio-error

Comment on lines +32 to +39
...(stage === "local"
? {
linkTextId: "connectMB.connectCable.skip",
onLink: LinkType.Skip,
}
: {
onLink: LinkType.None,
}),
Copy link
Author

Choose a reason for hiding this comment

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

For radio connection dev purposes, when locally developing, a skip button is visible for micro:bit 1 and the device Id is stored in the local storage.

@@ -44,7 +44,7 @@ const AddDataPage = () => {

const noStoredData = useMemo<boolean>(() => {
const gestureData = gestures.data;
return (
return !(
Copy link
Author

Choose a reason for hiding this comment

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

Small fix in logic in Add Data page so that data can be visible without connecting

@@ -22,13 +22,20 @@ const StartResumeActions = ({ ...props }: Partial<StackProps>) => {
}, [navigate]);

const handleStartNewSession = useCallback(() => {
startOverWarningDialogDisclosure.onClose();
Copy link
Author

Choose a reason for hiding this comment

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

Small fix: Close start over session warning dialog when new session is selected

@microbit-grace microbit-grace marked this pull request as ready for review August 1, 2024 14:58
@microbit-grace microbit-grace requested a review from a team August 1, 2024 14:58
@microbit-robert
Copy link

If you have no recordings and you lose the remote micro:bit connection, you get this screen, which is pretty weird.
image

The live graph also stops moving while "reconnecting" is shown, and I don't think that is right or matches the current behaviour in the nextgen/prototype version.

@microbit-robert
Copy link

If you reset the bridge micro:bit, we await the connection timeout, then show a dialog saying that the connection to micro:bit 1 has been lost, which isn't right. In the nextgen/prototype version, the reconnection attempt succeeds.

@microbit-robert
Copy link

microbit-robert commented Aug 2, 2024

Clicking "disconnect" now causes the following error Error: Bad status for 8 -> 255. This doesn't happen in the connection library demo, so I suspect it might be due to something being triggered here in response to the connection status updating?

EDIT: The Bad status for 8 -> 255 error only happens on my micro:bit v2.00, and it only happens when it's the bridge micro:bit and initially displaying a dot. After the first connection, the first disconnection fails. The device remains in a state where it is displaying a diamond. If you refresh the page and connect while the device is showing a diamond, subsequent disconnects and reconnects work as expected. This behaviour can be replicated in the connection library demo. The error occurs at the first writeMem32 call in the softwareReset method.

It is not clear if this is version or device specific.

EDIT: This has been resolved by adding software reset to the serial state change queue.

Copy link

@microbit-robert microbit-robert left a comment

Choose a reason for hiding this comment

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

I've skimmed through the code changes so far. I've hit a snag with the disconnect button with the radio bridge noted in a separate comment and can't review all of the potential flows until this has been ammended.

@microbit-grace
Copy link
Author

If you have no recordings and you lose the remote micro:bit connection, you get this screen, which is pretty weird.
The live graph also stops moving while "reconnecting" is shown, and I don't think that is right or matches the current behaviour in the nextgen/prototype version.

62f7dbf

@microbit-grace
Copy link
Author

If you reset the bridge micro:bit, we await the connection timeout, then show a dialog saying that the connection to micro:bit 1 has been lost, which isn't right. In the nextgen/prototype version, the reconnection attempt succeeds.

Related PR: microbit-foundation/microbit-connection#25

@microbit-grace microbit-grace removed the request for review from microbit-robert August 5, 2024 10:04
@microbit-grace microbit-grace requested review from a team and microbit-robert and removed request for a team and microbit-robert August 5, 2024 15:26
@microbit-robert
Copy link

Code changes look good. Will test tomorrow morning.

Copy link

@microbit-robert microbit-robert left a comment

Choose a reason for hiding this comment

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

LGTM. All previous change requests have been resolved.

@microbit-grace microbit-grace merged commit 7420da2 into react Aug 6, 2024
1 check passed
@microbit-grace microbit-grace deleted the radio-error branch August 6, 2024 09:48
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.

2 participants