fix(chrome): debounce sync-to-chrome export and set the exported profile's display name - #504
Merged
Merged
Conversation
Export cookies ~3s after the last command on a sync-to-chrome profile, even while tabs stay open. Idle-close export remains as a backstop.
Chrome auto-registers exported profiles as "Person N". Wait for the registration process to exit, then write Local State name to the alias.
Contributor
🟠 Maintainer review suggested — low confidenceThe automated review could not reach a fully supported conclusion. Limitations
This review is advisory and does not block merging. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Two follow-up fixes found while manually testing the just-shipped v0.8.3 Chrome-profile-export feature:
1. Export was gated on the browser being fully idle-closed, which in practice almost never happens
scheduleProfileIdle's idle timer never even gets set while any tab from the profile is still open (hasVisiblePagesguard) — andbrowser rundoesn't close its own resulting tab. Confirmed live: a profile sat "connected" for 4+ minutes with a tab open and only exported once its session was explicitly closed, which nobody would know to do.2. Exported profiles show up in Chrome as "Person 2", "Person 3", etc. instead of their real webcmd alias
Local Statedisplay name to match the webcmd alias exactly (e.g.test1shows astest1). Best-effort and silent on failure — purely cosmetic, never blocks the export. Documented limitation: if native Chrome was already running (registration got absorbed into the existing process rather than spawning a separate one), there's nothing safe to wait on, and the name write may later get overwritten by Chrome's own state flush.Test plan
runner.test.tsbrowser-context flakiness under high system load documented in prior PRs; all three files this PR touches pass 106/106 in isolation)🤖 Generated with Claude Code