Open
Conversation
There was a problem hiding this comment.
Performed full review of fe02e69...a6f392e
11 files reviewed | 0 comments | Review on Mesa | Edit Reviewer Settings
| // Initialize clipboard manager if not already done | ||
| if s.clipboardManager == nil { | ||
| s.clipboardManager = newClipboardManager() | ||
| } |
There was a problem hiding this comment.
Bug: Clipboard Manager Initialization Race Condition
A race condition exists in the lazy initialization of clipboardManager. Multiple concurrent requests to GetClipboard, SetClipboard, or StreamClipboard can cause several clipboardManager instances to be created. This leads to lost state and inconsistent behavior, potentially dropping clipboard events for watchers.
Contributor
|
Neat idea! Any thoughts about supporting clearing the clipboard? |
| log := logger.FromContext(ctx) | ||
| display := getDisplay() | ||
|
|
||
| // Create a temporary file to store the content (more reliable than piping for large content) |
Contributor
There was a problem hiding this comment.
Possibly this is an outdated comment?
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.
/clipboardroutesTL;DR
Introduced new
/clipboardAPI endpoints to get, set, and stream system clipboard content, extending server capabilities for external application interaction.Why we made these changes
To enhance server functionality by providing programmatic access to the system clipboard, enabling external applications to interact with clipboard data.
What changed?
clipboard.go, leveragingxclip.openapi.yamland regenerated OpenAPI files (oapi.go,clipboard_types.go,server_handlers.go).ApiServicewas enhanced with aclipboardManager, andmain.goexplicitly registers the new handlers.go.modandgo.sumwere updated to reflect new direct and indirect Go dependencies, includingoapi-codegen.clipboard_test.gofor the clipboard API functionalities.README.mdwas updated withcurlexamples for the new routes.Description generated by Mesa. Update settings