fix: address audit findings — fitting trigger, race guards, state conflicts
wear-check: - Send weak pulse light (brightness=26) to trigger FFE4 fitting report - Timeout degrades to pass (backward compat with 17-byte firmware) - Sync _resolved flag prevents double-resolve treating: - Only treat run_state=0x00 as completion after seeing run_state=0x02 (prevents false completion on startup) - Sync _finishing flag replaces async data.completed for race prevention - onStatus preserves paused state during fitting loss (|| fittingLost) - Remove dead _fittingTimer reference from onUnload auto-scan: - Sync _completed flag in _scanComplete prevents double-build
这个提交包含在:
@@ -43,6 +43,7 @@ Page({
|
||||
startScan: function () {
|
||||
var self = this
|
||||
self._scanResults = []
|
||||
self._completed = false
|
||||
|
||||
if (!ble.isConnected()) {
|
||||
self.setData({ scanning: false, error: '设备未连接,请先连接设备' })
|
||||
@@ -110,6 +111,8 @@ Page({
|
||||
},
|
||||
|
||||
_scanComplete: function () {
|
||||
if (this._completed) return
|
||||
this._completed = true
|
||||
this._cleanup()
|
||||
this.setData({ scanning: false, scanProgress: 100 })
|
||||
this._buildDisplay()
|
||||
|
||||
在新工单中引用
屏蔽一个用户