Skip to content

Add support for sending messages to external clients#273

Open
brollb wants to merge 3 commits intomainfrom
support-external-clients-messaging
Open

Add support for sending messages to external clients#273
brollb wants to merge 3 commits intomainfrom
support-external-clients-messaging

Conversation

@brollb
Copy link
Copy Markdown
Contributor

@brollb brollb commented Sep 9, 2025

This adds support for external clients wrt messages originating from services. However, some services require the room/role concept which is not supported by external clients. These will still not receive messages.

At a high level, the message sending API on the cloud supports sending the client state. If the client's state has changed by the time the message is sent, the message will be dropped. Currently, it assumes every client is a browser client. This is problematic bc that means the NetsBlox cloud will drop every message for external clients.

This PR updates this logic to simply pass the state received from the client along to the NetsBlox cloud - rather than reconstruct it (incorrectly).

Note: This hasn't been tested.

@brollb brollb requested a review from Copilot September 9, 2025 19:11
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds support for sending messages to external clients by refactoring the message handling system to use state-based targeting instead of project/role-based targeting. The changes enable services to send messages to clients that don't have traditional room/role concepts.

  • Modified message targeting to use client state instead of project/role IDs
  • Updated RemoteClient constructor to accept state parameter
  • Added state information to service context for external client support

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
src/remote-client.js Updated constructor to accept state parameter and modified message sending to use state-based targeting
src/procedures/alexa/skill.js Updated RemoteClient instantiation to pass state instead of individual project/role IDs
src/messages.js Refactored SendMessageToClient to accept state directly and added documentation
src/api.js Added state to service context and updated RemoteClient instantiation

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment thread src/remote-client.js Outdated
Comment thread src/remote-client.js
brollb and others added 2 commits September 9, 2025 14:14
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants