-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor(thread): refactor hasCapability call with a better readable way #3732
Open
Sma1lboy
wants to merge
19
commits into
TabbyML:main
Choose a base branch
from
Sma1lboy:refactor-hasCapability-with-proxy-has
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
refactor(thread): refactor hasCapability call with a better readable way #3732
Sma1lboy
wants to merge
19
commits into
TabbyML:main
from
Sma1lboy:refactor-hasCapability-with-proxy-has
Conversation
This file contains 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
Sma1lboy
force-pushed
the
refactor-hasCapability-with-proxy-has
branch
from
January 21, 2025 08:28
6edd0dd
to
9d8fbbe
Compare
…eateCallable with state management
Sma1lboy
force-pushed
the
refactor-hasCapability-with-proxy-has
branch
from
January 21, 2025 09:12
7a4f2a3
to
02e80a6
Compare
… ClientApi with supports method
Sma1lboy
force-pushed
the
refactor-hasCapability-with-proxy-has
branch
from
January 22, 2025 20:21
49668c6
to
9e2fc10
Compare
…essary conditional block refactor(chat-page): simplify capability checks by consolidating server support evaluations refactor(chat-webview): remove redundant logging during initialization
Sma1lboy
force-pushed
the
refactor-hasCapability-with-proxy-has
branch
from
January 22, 2025 20:35
ec3200d
to
524913d
Compare
…ving unnecessary async/await
…rame and simplify listen method signature
…oving unnecessary console logs and streamlining method checks
Sma1lboy
force-pushed
the
refactor-hasCapability-with-proxy-has
branch
from
January 24, 2025 01:42
822a05a
to
2d177e7
Compare
…return for unsupported properties
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.
Deprecated
Check #3757
Description
In the new version, we will no longer use hasCapability individually to check exposed APIs. Instead, we will obtain them during the communication establishment between two threads. Here we provide 1 protocol change and 2 inner thread methods.
Protocol Change
Added a mechanism to exchange exposed APIs. When data is received, it will be automatically saved to cache.
Inner Thread Methods
Clarification: 'A' represents Outside (the IDE/client), while 'B' represents Inside (the server).
In our scenario, A is always created first, followed by B. This ensures B can successfully send messages to A. However, if A arrives too early, B might not receive the message signal. Furthermore, we only need A's Exposed APIs on the B side (server side). Currently, we only use requestMethods in
createThreadFromInsideIframe
.By the way, we could also use exposed methods to check server's exposed APIs?
I have added numerous logs for now, which will be cleaned up after review.
Demo
Screenshot from log
Also the way we call in server side, We can now directly check whether the method exists; if it does not, it will be undefined