Sincronizza overlay video con punteggio dalla regia remota.
L'iPad accetta gli aggiornamenti ActionCable della regia, evita race con risposte API obsolete e ridisegna subito il tabellone sullo stream RTMP. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -81,4 +81,24 @@ final class ScoreControllerTests: XCTestCase {
|
||||
q2.awayPoints = 8
|
||||
XCTAssertGreaterThan(q2.progressKey(), q1.progressKey())
|
||||
}
|
||||
|
||||
func testCableRemoteCancelsStaleLocalSync() {
|
||||
let controller = ScoreController(
|
||||
scoreRepository: ScoreRepository(api: MatchLiveAPI()),
|
||||
sessionCable: SessionCableService()
|
||||
)
|
||||
var local = ScoreState(boardType: "basket", period: 1, periodLabel: "Q1")
|
||||
local.homePoints = 5
|
||||
local.awayPoints = 4
|
||||
controller.bind(sessionId: "session-1", initial: local)
|
||||
controller.applyAction("home_point")
|
||||
|
||||
var remote = ScoreState(boardType: "basket", period: 1, periodLabel: "Q1")
|
||||
remote.homePoints = 6
|
||||
remote.awayPoints = 7
|
||||
controller.applyRemote(remote, source: .cable)
|
||||
|
||||
XCTAssertEqual(controller.score.homePoints, 6)
|
||||
XCTAssertEqual(controller.score.awayPoints, 7)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user