fix(update): reset firmware state after completion and fix upload race#108
Merged
JanZachmann merged 1 commit intomainfrom Mar 1, 2026
Merged
fix(update): reset firmware state after completion and fix upload race#108JanZachmann merged 1 commit intomainfrom
JanZachmann merged 1 commit intomainfrom
Conversation
- Add is_actual_update_result() helper to distinguish Succeeded/Recovered
from NoUpdate; the existing is_update_complete() matches all three for
polling purposes but cleanup must only run on actual update results
- Clear model.update_manifest and firmware_upload_state in Core when a
firmware update completes (Succeeded or Recovered) so the update page
is fresh after reconnection
- Fix upload TypeError race in UpdateFileUpload.vue: sync.ts replaces the
deviceOperationState object reference on every Core render, so the { deep: true }
watcher fired on each render and cleared updateFile.value while an axios
POST was in-flight, causing "Cannot read properties of undefined (reading 'name')";
guard with oldState transition check and capture file reference before await
- Expose updateValidationAcked from Core healthcheck through sync.ts/types
so App.vue can use the live value across SPA re-logins instead of the
stale onMounted snapshot
- Use combined watcher on status + ackedInHealthcheck + ackedOnMount to
correctly show the update validation modal on re-login in the same SPA
session after a second update
- Snapshot factoryResetError/factoryResetContext and updateValidationIsRollback
into local refs so the dialog template is decoupled from the live ViewModel
during close animation
- Add FIRMWARE_UPDATE_TIMEOUT_OVERRIDE_MS test env var and wire into
startReconnectionPolling alongside the existing reboot/factory-reset overrides
- Rename SOCKET_PATH env var to DEVICE_SERVICE_SOCKET_PATH with updated default
- Add E2E tests for rollback notification, timeout state, second rollback
modal in same SPA session, update success, and upload regression after rollback
Signed-off-by: Jan Zachmann <50990105+JanZachmann@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
update_manifestandfirmware_upload_statewhen a firmware update completes (SucceededorRecovered), so the update page is fresh after reconnection. A newis_actual_update_result()helper distinguishes these fromNoUpdate(which is used for polling only).UpdateFileUpload.vue:sync.tsreplaces thedeviceOperationStateobject reference on every Core render. The previous{ deep: true }watcher fired on each render and could clearupdateFile.valuewhile an axios POST was in-flight, causingCannot read properties of undefined (reading 'name'). Fixed by guarding with anoldStatetransition check and capturing the file reference beforeawait.status,ackedInHealthcheck(live Core value), andackedOnMount(onMounted snapshot) so a second rollback/success modal appears correctly in the same SPA session after a second update.VITE_FIRMWARE_UPDATE_TIMEOUT_MStest override and wire intostartReconnectionPollingalongside the existing reboot/factory-reset overrides.SOCKET_PATH→DEVICE_SERVICE_SOCKET_PATHwith updated default path.Reason
HealthcheckResponse(Ok(Recovered))events each triggered a Core render, flooding the watcher and racing with a user-initiated upload.updateValidationAckedOnMountwas stale after re-login without a page reload.