Add support for proper integration with boring-notch#210
Conversation
|
@sozercan can you take a lot at this PR real quick? |
There was a problem hiding this comment.
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 5/5 changed files
- Comments generated: 4
|
@sozercan can you try to invoke Copilot? It seems like it doesn't respond to my comments |
|
I've spent some AI tokens, now the issues should be fixed as well as the formatting and linting |
|
@sozercan do you plan to even merge it all? |
| } | ||
|
|
||
| let response = Self.webSocketHandshakeResponse(secWebSocketKey: secWebSocketKey) | ||
| self.sendHTTPResponse(id: connectionID, response) |
| // Check if host represents loopback | ||
| let debugDesc = host.debugDescription | ||
| isLoopback = debugDesc.contains("127.0.0.1") || debugDesc.contains("::1") || debugDesc.contains("localhost") |
|
|
||
| do { | ||
| let parameters = NWParameters.tcp | ||
| parameters.allowLocalEndpointReuse = true |
| do { | ||
| let parameters = NWParameters.tcp | ||
| parameters.allowLocalEndpointReuse = true | ||
| // Constrain listener to loopback interface to prevent unintended network exposure |
| if previous == nil { | ||
| self.broadcastWebSocketJSON(self.playerInfoPayload(type: "PLAYER_INFO", snapshot: snapshot)) | ||
| } | ||
|
|
||
| if previous?.videoId != snapshot.videoId { | ||
| self.broadcastWebSocketJSON(self.playerInfoPayload(type: "VIDEO_CHANGED", snapshot: snapshot)) | ||
| // Some clients only refresh now-playing metadata on PLAYER_INFO. | ||
| self.broadcastWebSocketJSON(self.playerInfoPayload(type: "PLAYER_INFO", snapshot: snapshot)) | ||
| } | ||
|
|
||
| if previous?.isPaused != snapshot.isPaused { | ||
| self.broadcastWebSocketJSON(self.playerInfoPayload(type: "PLAYER_STATE_CHANGED", snapshot: snapshot)) | ||
| } | ||
|
|
||
| if previous?.title != snapshot.title || previous?.artist != snapshot.artist || previous?.album != snapshot.album { | ||
| self.broadcastWebSocketJSON(self.playerInfoPayload(type: "PLAYER_INFO", snapshot: snapshot)) | ||
| } |
| self.listener?.cancel() | ||
| for state in self.connections.values { | ||
| state.connection.cancel() | ||
| } | ||
| self.monitorTask?.cancel() |
|
@BierDav do you know when TheBoredTeam/boring.notch#1193 might be merged? I don’t use Boring Notch myself, so it’s a bit harder for me to prioritize |
|
It is a bit of a deadlock situation, currently 😅 but considering that boring.notch is the bigger project it would make sense to me to merge it here first. Additionally the change in boring notch is very small. It basically only consists of adding the bundle id of kaset |
Screen.Recording.2026-04-22.at.07.36.49.mov
Mind that this PR relies on TheBoredTeam/boring.notch#1193 and vice versa