Skip to content

Commit eaf554f

Browse files
committed
Fix assertion failure due to browser non-monotonic timestamp
1 parent d008e8d commit eaf554f

File tree

1 file changed

+2
-1
lines changed
  • editor/src/messages/input_mapper/utility_types

1 file changed

+2
-1
lines changed

editor/src/messages/input_mapper/utility_types/misc.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,8 @@ impl FrameTimeInfo {
139139
}
140140

141141
pub fn advance_timestamp(&mut self, next_timestamp: Duration) {
142-
debug_assert!(next_timestamp >= self.timestamp);
142+
// Guard against non-monotonic timestamps from the browser (Keavon observed this once in Chrome)
143+
let next_timestamp = next_timestamp.max(self.timestamp);
143144

144145
self.prev_timestamp = Some(self.timestamp);
145146
self.timestamp = next_timestamp;

0 commit comments

Comments
 (0)