Repository navigation
Updated tabs engine code to enable batch syncing - #7793
lougeniaC64 wants to merge 1 commit into
Conversation
7879fa3 to
63ede4a
Compare
| // device's record changes, so there's then nothing to clean up either. | ||
| if !remote_tabs.is_empty() { | ||
| storage.replace_remote_tabs(&remote_tabs)?; | ||
| storage.remove_old_pending_closures(&remote_tabs)?; |
There was a problem hiding this comment.
this is a semantic change iiuc - previously, even with no incoming tabs, we would remove pending commands older than REMOTE_COMMAND_TTL_MS. It not immediately obvious this matters in practice, but also not clear why it was made - ie, I'm not sure it is wrong, but also not sure it is particularly relevant to what this PR is addressing?
|
|
||
| // Completed "close tab" requests are resolved when the device's record | ||
| // arrives: `stage_incoming` cleans them up, without waiting for `apply()`. | ||
| #[test] |
There was a problem hiding this comment.
just to be sure, these tests both worked without the changes? (which seems fine, just trying to understand the scope of this)
| if let Some(conn) = self.open_if_exists()? { | ||
| if let Some(last_sync) = last_sync { | ||
| let client_ttl_ms = (TABS_CLIENT_TTL as i64) * 1000; | ||
| // On desktop, a quick write temporarily sets the last_sync to FAR_FUTURE |
There was a problem hiding this comment.
not directly related to this patch, but related to the new test for this, I think this comment is now stale and should be updated - desktop no longer does that.
| // last-sync at FAR_FUTURE. Measured from that, every client would look | ||
| // stale, so `remove_stale_clients` must leave them all alone. | ||
| #[test] | ||
| fn test_remove_stale_clients_ignores_far_future_last_sync() { |
There was a problem hiding this comment.
I'm a little torn about this - it's not directly related to the PR, and is testing what's now redundant code, but OTOH it is testing a real path - so let's keep this test but update the comment above and we can just treat it as a ride-along improvement.
Updating the tab engine's implementation of
stage_incomingso that the forthcoming sync batching PR doesn't require stage_incoming to be called at least once regardless of whether there are no incoming records. This includes:remove_old_pending_closuresif there are incoming recordsremove_stale_clientsto theremove_stale_clientsfunctionPull Request checklist
[ci full]to the PR title.