Commit Graph
102 Commits
Author SHA1 Message Date
David Lechner e984cffbb4 add try/catch for unexpected errors 2021-01-22 16:30:52 -06:00
David Lechner e5d98cdd84 add proper error handling for bad device id 2021-01-22 16:22:54 -06:00
David Lechner 3ec067e930 add test for unknown bootloader command 2021-01-22 16:08:13 -06:00
David Lechner 8ad2b78d4c add proper error handling for hub erase fail 2021-01-22 15:58:10 -06:00
David Lechner c1c08e5ced add state initializer in async saga constructor 2021-01-22 15:58:10 -06:00
David Lechner 08fea237c9 change setState() to updateState()
this way we don't wipe out state if we change a different value
2021-01-22 15:58:10 -06:00
David Lechner 79e06bcd51 add test for response timeout 2021-01-22 15:58:10 -06:00
David Lechner 7a5e344b66 add helper function to disconnect and cancel 2021-01-22 15:58:10 -06:00
David Lechner a88fa3d425 consolidate firmware fail to start and finish
they had too much overlap
2021-01-22 15:58:10 -06:00
David Lechner f3eef68131 add proper error handling of BLE send error 2021-01-22 15:58:10 -06:00
David Lechner 18edc7870e add disconnect monitor to firmware flash sagas 2021-01-22 15:58:10 -06:00
David Lechner 2d44705112 proper error handling for failure to connect 2021-01-22 15:58:10 -06:00
David Lechner d38ae70ab2 proper error handling for bad checksum algorithm 2021-01-22 15:58:10 -06:00
David Lechner 9261b8743c proper error handling for firmware too big 2021-01-22 15:58:10 -06:00
David Lechner 4707b77135 proper error handling for compiler error 2021-01-22 15:58:10 -06:00
David Lechner e229f08ffd switch to inline snapshots in tests 2021-01-22 15:58:10 -06:00
David Lechner b1efa04947 proper error handling for mpy-cross ABI version 2021-01-22 15:58:10 -06:00
David Lechner caacaad341 use recursive partial so we don't have to use "as" 2021-01-22 10:35:11 -06:00
David Lechner 218dda4d0b use typed-redux-saga in flash-firmware sagas
This make things a bit more type safe and a bit easier to read.
2021-01-21 22:22:46 -06:00
David Lechner ab0c850b80 add proper error handling for firmware zip error 2021-01-21 19:49:53 -06:00
David Lechner 3b31412186 minor code improvements in flash-firmware 2021-01-21 12:37:29 -06:00
David Lechner 6f6bf26854 add basic flash-firmware sagas tests
So far just testing the success paths, no errors.
2021-01-21 12:37:29 -06:00
David Lechner 9d7845237c rename waitForDidSend to waitForDidRequest
This better reflects what the function actually does.
2021-01-21 12:37:29 -06:00
David Lechner f186e6414d decouple message id counter from actions
Actions should be pure functions for ease of testing.
2021-01-21 12:37:29 -06:00
David Lechner 91938e34d9 add special notification for unexpected errors
Since these errors are not expected, we want to make it really easy to
report them.
2021-01-21 12:37:29 -06:00
David Lechner 2659c064fa make bootloader failure reasons more strongly typed
This way we don't have to do extra null checks elsewhere.
2021-01-21 12:37:29 -06:00
David Lechner 904de515c0 fix missing newlines in compiler error 2021-01-21 12:37:29 -06:00
David Lechner 647985906d add test for app sagas 2021-01-19 17:20:56 -06:00
David Lechner bab35e8c45 move progress from status bar to firmware button 2021-01-19 17:20:56 -06:00
David Lechner 816053ba7c don't expect response on disconnect commands
The LWP3 bootloader disconnect and reboot commands cause the device
to disconnect before sending a response, so we must always use
write without response for these, otherwise the program can hang
waiting for a response.
2021-01-19 17:20:56 -06:00
David Lechner 2ff5ce9852 dismiss compile error notification on successful compile
If we got a successful compile, then the error is no longer applicable.
2021-01-19 17:20:56 -06:00
David Lechner f87f9b1b89 associate related programChanged translations 2021-01-18 18:56:02 -06:00
David Lechner 5a66f041f2 update new version experience
This changes the new version message to be more user-friendly and allows
using the new version without restarting the browser or clearing the
cache.
2021-01-18 18:51:38 -06:00
David Lechner c8d499e979 drop notification for service worker success action
This isn't particularly useful information.
2021-01-18 17:44:26 -06:00
David Lechner da298ab565 add some tests for notification sagas 2021-01-18 17:29:04 -06:00
David Lechner f72c6ad5de rename app startup action using do/did pattern 2021-01-18 17:29:03 -06:00
David Lechner 54439a4cbc convert notifications to static API
This converts notifications from a reducer to a saga. This way, our
state doesn't get bogged down with a bunch of notifications.
2021-01-18 17:29:03 -06:00
David Lechner 8c1e9a8273 implement license saga tests 2021-01-17 14:59:03 -06:00
David Lechner 1626533cca add license dialog 2021-01-17 10:39:38 -06:00
David Lechner f54beab97f use consistent tooltip delay 2021-01-15 11:08:04 -06:00
David Lechner f4cb69f995 add setting to flash current user program 2021-01-14 18:03:04 -06:00
David Lechner a48f3f381e convert settings to do/did action pattern 2021-01-14 15:12:49 -06:00
David Lechner b15b2e1dea move docs toggle to settings 2021-01-14 10:55:00 -06:00
David Lechner d7dbaaa12d add dark mode setting 2021-01-11 23:36:48 -06:00
David Lechner 41a1cee092 change support button to settings button
and add new empty settings drawer
2021-01-11 23:36:48 -06:00
David Lechner 69e52be259 remove wasm file extension rename workaround
This modifies the webpack config instead of renaming the .wasm file
to workaround default webpack behavior regarding import .wasm files.
2021-01-11 16:47:49 -06:00
David Lechner ae996453e8 drop polyfill for chromimum < v85
This removes the polyfill for using older chrome browsers before the
writeWithResponse and writeWithoutResponse APIs were added.
2020-12-21 13:05:47 -06:00
David Lechner 32f2120ec6 fix timeout when firmware size is 10x packet size
When the firmware blob is exactly a multiple of 10 times the packet
size, the last checksum request causes the reply to the last program
request to be missed (there is only a response from the hub to the very
last program request). The program response is received, then the
checksum response is received. Since the saga is waiting for the
checksum response first, the program response is discarded.

Fix by breaking out of the loop when the firmware has been fully
transferred before making the checksum request.

Fixes: pybricks/support#178
2020-12-18 14:09:54 -06:00
David Lechner 4ee50072a0 Update firmware to v3.0.0a11
Also take advantage of new helper functions in firmware package.
2020-11-20 21:08:53 -06:00
David Lechner 71ad9c1b1b Update to create-react-app 4
- had to update eslint deps
- ran into https://github.com/palantir/blueprint/issues/4112
- had to move beta.svg out of static/
- had to fix prettier formatting changes
- ran into https://github.com/facebook/jest/issues/7780
2020-11-20 21:08:53 -06:00