fix(daemon): retain sync batches across detach and replace
- commit
- cf75aa04e71600644d4bd20d8e1f9800c4b78174
- author
- brice · · 2026-07-11 21:50 UTC
- parent
- 8d4da10
- signature
- GPG Verified
CD88F9E564E0102646FB6077A1A07C7C7C3E349D· arch-gpg Verified for the committer email
1 file · +0 -6
M internal/usecase/daemon/render_coordinator.go +0 -6
| @@ -607,7 +607,6 @@ func (c *renderCoordinator) wakeCurrent(w renderWake) bool { | |||
| 607 | 607 | func (c *renderCoordinator) noteDetach(ac *attachedClient) { | |
| 608 | 608 | c.mu.Lock() | |
| 609 | 609 | var timer ports.Timer | |
| 610 | - | var timers []ports.Timer | |
| 611 | 610 | if c.attachment == ac { | |
| 612 | 611 | c.advanceAttachmentEpochLocked(ac) | |
| 613 | 612 | c.attachment = nil | |
| @@ -619,11 +618,9 @@ func (c *renderCoordinator) noteDetach(ac *attachedClient) { | |||
| 619 | 618 | c.generation++ | |
| 620 | 619 | c.armed = false | |
| 621 | 620 | timer = c.detachNormalTimerLocked() | |
| 622 | - | timers = c.detachSyncTimersLocked() | |
| 623 | 621 | } | |
| 624 | 622 | c.mu.Unlock() | |
| 625 | 623 | stopTimer(timer) | |
| 626 | - | stopTimers(timers) | |
| 627 | 624 | } | |
| 628 | 625 | ||
| 629 | 626 | // noteReplace hands the coordinator from old to replacement; callbacks | |
| @@ -639,7 +636,6 @@ func (c *renderCoordinator) noteReplace(old, replacement *attachedClient, readin | |||
| 639 | 636 | // identity to invalidate, and the replacement becomes the first bound | |
| 640 | 637 | // attachment atomically with this lifecycle transition. | |
| 641 | 638 | var timer ports.Timer | |
| 642 | - | var timers []ports.Timer | |
| 643 | 639 | if c.attachment == old || c.attachment == nil { | |
| 644 | 640 | c.advanceAttachmentEpochLocked(old, replacement) | |
| 645 | 641 | c.attachment = replacement | |
| @@ -654,11 +650,9 @@ func (c *renderCoordinator) noteReplace(old, replacement *attachedClient, readin | |||
| 654 | 650 | c.generation++ | |
| 655 | 651 | c.armed = false | |
| 656 | 652 | timer = c.detachNormalTimerLocked() | |
| 657 | - | timers = c.detachSyncTimersLocked() | |
| 658 | 653 | } | |
| 659 | 654 | c.mu.Unlock() | |
| 660 | 655 | stopTimer(timer) | |
| 661 | - | stopTimers(timers) | |
| 662 | 656 | } | |
| 663 | 657 | ||
| 664 | 658 | // notePark invalidates pending wakes when the attachment parks for resume. | |
| @@ -607,7 +607,6 @@ func (c *renderCoordinator) wakeCurrent(w renderWake) bool { | |||||
| 607 | func (c *renderCoordinator) noteDetach(ac *attachedClient) { | 607 | func (c *renderCoordinator) noteDetach(ac *attachedClient) { | ||
| 608 | c.mu.Lock() | 608 | c.mu.Lock() | ||
| 609 | var timer ports.Timer | 609 | var timer ports.Timer | ||
| 610 | - | var timers []ports.Timer | |||
| 611 | if c.attachment == ac { | 610 | if c.attachment == ac { | ||
| 612 | c.advanceAttachmentEpochLocked(ac) | 611 | c.advanceAttachmentEpochLocked(ac) | ||
| 613 | c.attachment = nil | 612 | c.attachment = nil | ||
| @@ -619,11 +618,9 @@ func (c *renderCoordinator) noteDetach(ac *attachedClient) { | |||||
| 619 | c.generation++ | 618 | c.generation++ | ||
| 620 | c.armed = false | 619 | c.armed = false | ||
| 621 | timer = c.detachNormalTimerLocked() | 620 | timer = c.detachNormalTimerLocked() | ||
| 622 | - | timers = c.detachSyncTimersLocked() | |||
| 623 | } | 621 | } | ||
| 624 | c.mu.Unlock() | 622 | c.mu.Unlock() | ||
| 625 | stopTimer(timer) | 623 | stopTimer(timer) | ||
| 626 | - | stopTimers(timers) | |||
| 627 | } | 624 | } | ||
| 628 | 625 | ||||
| 629 | // noteReplace hands the coordinator from old to replacement; callbacks | 626 | // noteReplace hands the coordinator from old to replacement; callbacks | ||
| @@ -639,7 +636,6 @@ func (c *renderCoordinator) noteReplace(old, replacement *attachedClient, readin | |||||
| 639 | // identity to invalidate, and the replacement becomes the first bound | 636 | // identity to invalidate, and the replacement becomes the first bound | ||
| 640 | // attachment atomically with this lifecycle transition. | 637 | // attachment atomically with this lifecycle transition. | ||
| 641 | var timer ports.Timer | 638 | var timer ports.Timer | ||
| 642 | - | var timers []ports.Timer | |||
| 643 | if c.attachment == old || c.attachment == nil { | 639 | if c.attachment == old || c.attachment == nil { | ||
| 644 | c.advanceAttachmentEpochLocked(old, replacement) | 640 | c.advanceAttachmentEpochLocked(old, replacement) | ||
| 645 | c.attachment = replacement | 641 | c.attachment = replacement | ||
| @@ -654,11 +650,9 @@ func (c *renderCoordinator) noteReplace(old, replacement *attachedClient, readin | |||||
| 654 | c.generation++ | 650 | c.generation++ | ||
| 655 | c.armed = false | 651 | c.armed = false | ||
| 656 | timer = c.detachNormalTimerLocked() | 652 | timer = c.detachNormalTimerLocked() | ||
| 657 | - | timers = c.detachSyncTimersLocked() | |||
| 658 | } | 653 | } | ||
| 659 | c.mu.Unlock() | 654 | c.mu.Unlock() | ||
| 660 | stopTimer(timer) | 655 | stopTimer(timer) | ||
| 661 | - | stopTimers(timers) | |||
| 662 | } | 656 | } | ||
| 663 | 657 | ||||
| 664 | // notePark invalidates pending wakes when the attachment parks for resume. | 658 | // notePark invalidates pending wakes when the attachment parks for resume. | ||