feat: update mesh-v2 examples for polling protocol and new API#372
Merged
takaokouji merged 4 commits intodevelopfrom Mar 24, 2026
Merged
feat: update mesh-v2 examples for polling protocol and new API#372takaokouji merged 4 commits intodevelopfrom
takaokouji merged 4 commits intodevelopfrom
Conversation
- Add !examples/**/*.js to .gitignore to track example source files - Add useWebSocket and maxConnectionTimeSeconds params to createGroup - Remove createdAt from all queries (not in schema) - Add useWebSocket and pollingIntervalSeconds to Group/Node responses - Add searchGroupsByNamePrefix query - Add getEventsSince query (polling protocol) - Add recordEventsByNode mutation (polling protocol) - Track mesh-client.js, app.js, and server.js in git (previously untracked) Refs #371 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
app.js: - Add WebSocket/Polling mode switching based on group.useWebSocket - Implement polling loop (getEventsSince + listGroupStatuses) - Use recordEventsByNode for event sending in polling mode - Update default heartbeat interval fallback to 15s (stg value) - Update session timer fallback to 35min (prod maxConnectionTime) - Add stopCommunication() to centralize subscription + polling cleanup index.html: - Add protocol selection radio buttons (WebSocket / Polling) - Add polling status display (last poll time) in Current Group panel Refs #371 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Add dual protocol support description (WebSocket / Polling) - Update session time from 10min to 35min - Add protocol selection instructions in Create Group section - Note polling fallback behavior for firewalls Refs #371 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
listGroupsByDomain and listNodesInGroup can return groups/nodes created before useWebSocket was added, which have null values for the non-nullable Boolean! field. Remove these fields from list queries since they are available from createGroup/joinGroup responses. Also fix group list badge to handle undefined useWebSocket gracefully. Refs #371 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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
useWebSocket,maxConnectionTimeSeconds, polling mutations/queries)*.jsgitignore)Changes
mesh-client.js
createGroup: adduseWebSocket: Boolean!(required) andmaxConnectionTimeSeconds: IntparamscreatedAtfrom all queries (not in schema)useWebSocket,pollingIntervalSecondsto Group/Node response fieldssearchGroupsByNamePrefix,getEventsSince,recordEventsByNodeapp.js
fireEventsByNode(WS) vsrecordEventsByNode(Polling)getEventsSince+listGroupStatusesat server-configured intervalindex.html
.gitignore
!examples/**/*.jsto track example source filesImplementation Steps
Definition of Done
createGroupにuseWebSocket: trueを渡してグループ作成が成功することuseWebSocket: false)でイベント送受信ができることnpm run buildin examples dir)Closes #371
🤖 Generated with Claude Code