Merged
Conversation
* fix: reinitialize connection when page becomes visible after idle timeout When all tabs become invisible and the SharedWorker disconnects due to idle timeout, the tabs are removed from the Worker's tab list. When user switches back to the page, the TAB_VISIBILITY message fails because the tab no longer exists. This fix adds a reinitialize() method that: - Sends TAB_INIT to re-add the tab to the Worker - Re-registers all callbacks - Called when page becomes visible and connection is not established Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * fix: handle tab not found by notifying tab to reinitialize When SharedWorker's TAB_VISIBILITY message is received but the tab no longer exists in Worker's tab list (due to cleanup timer or idle timeout removal), Worker now sends WORKER_TAB_NOT_FOUND message back to the tab, triggering reinitialization. Changes: - Add WORKER_TAB_NOT_FOUND message type to WorkerToTabMessageType - Modify updateTabVisibility to return boolean indicating success - Send TAB_NOT_FOUND notification when tab doesn't exist - Handle WORKER_TAB_NOT_FOUND in SharedWorkerManager by calling reinitialize() Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * chore: bump version to 1.0.1 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * chore: update settings.local.json to add new Bash commands - Added "Bash(gh pr view:*)" and "Bash(gh pr edit:*)" to the list of available commands for enhanced functionality. * chore: bump version to 1.0.2 Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> --------- Co-authored-by: 刘勇杰 <motou2017@163.com> Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
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.
When all tabs become invisible and the SharedWorker disconnects due to idle timeout, the tabs are removed from the Worker's tab list. When user switches back to the page, the TAB_VISIBILITY message fails because the tab no longer exists.
This fix adds a reinitialize() method that:
When SharedWorker's TAB_VISIBILITY message is received but the tab no longer exists in Worker's tab list (due to cleanup timer or idle timeout removal), Worker now sends WORKER_TAB_NOT_FOUND message back to the tab, triggering reinitialization.
Changes:
chore: bump version to 1.0.1
chore: update settings.local.json to add new Bash commands