Update sockethub integration for latest API#305
Open
silverbucket wants to merge 3 commits intochore/upgrade_emberfrom
Open
Update sockethub integration for latest API#305silverbucket wants to merge 3 commits intochore/upgrade_emberfrom
silverbucket wants to merge 3 commits intochore/upgrade_emberfrom
Conversation
Replace CDN-loaded scripts with @sockethub/client and socket.io-client npm packages. Adapt to the new client lifecycle (ready(), contextFor(), platform schema validation) and ActivityStreams message format: - Use @context arrays from server registry instead of context property - Wrap actor/target as objects with id and type - IRC channel IDs now use channel@hostname format - Add completed/failed/client_error event listeners - Resolve platform from @context for incoming message routing - Refactor transferMeMessage to accept channel object directly - Remove deprecated observe handler and ActivityStreams.Object.create
2 tasks
There was a problem hiding this comment.
Pull request overview
Updates Hyperchannel’s Sockethub integration to use the latest client API shipped via npm packages, and adapts message/job handling to the new @context/lifecycle model.
Changes:
- Replaces CDN-loaded Sockethub client usage with
@sockethub/client+socket.io-client, and updates initialization (ready()). - Updates IRC/XMPP transport services to emit jobs using
@contextarrays and structuredactor/targetobjects; updates IRC channel ID format. - Adds handling for Sockethub job lifecycle events (
completed,failed,client_error) and routes incoming messages based on@context.
Reviewed changes
Copilot reviewed 8 out of 9 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/unit/services/sockethub-xmpp-test.js | Updates unit tests to reflect the new @context job format and removes pre-registration assumptions. |
| package.json | Adds @sockethub/client and socket.io-client dependencies. |
| package-lock.json | Locks new Sockethub and Socket.IO client dependency graph. |
| app/services/sockethub.js | Migrates to npm-based Sockethub client initialization and adds contextFor() / platformForMessage() helpers. |
| app/services/sockethub-xmpp.js | Refactors XMPP job payloads to the new schema (@context, structured actor/target). |
| app/services/sockethub-irc.js | Refactors IRC job payloads to the new schema and adapts to the new IRC channel ID format. |
| app/services/coms.js | Adds job lifecycle listeners and routes incoming messages using platform derived from @context. |
| app/models/base_channel.js | Updates IRC Sockethub channel ID format to channel@hostname. |
| app/controllers/base_channel.js | Updates /me command path to use the refactored transferMeMessage signature. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Add early return with console.warn in handleSockethubMessage and handleJobCompleted when platformForMessage returns undefined - Switch double quotes to single quotes in test target objects
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 8 out of 9 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Skip join dispatch in handleJobCompleted since per-emit callbacks in sockethub-irc/xmpp.join() already handle it - Normalize XMPP credentials callback to extract msg.error like IRC, preventing false failure logs on object acks
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.
Summary
@sockethub/client@^5.0.0-alpha.12andsocket.io-clientnpm packagesready()initialization,contextFor()for dynamic@contextarrays, platform schema validation@contextarrays from server registry instead of thecontextstring property on outgoing messagesactorandtargetas objects withidandtypepropertieschannel@hostnameformat (washostname/channel)completed,failed, andclient_errorevent listeners for proper job status tracking@contextfor incoming message routing viaplatformForMessage()transferMeMessageto accept channel object directly (consistent withtransferMessage)observehandler andActivityStreams.Object.create()pre-registration callsTest plan