Skip to content

fix/9.1: Wire RelayMessageFramer to shared Relay types#124

Merged
detain merged 1 commit into
masterfrom
fix/9.1-server-relay-wiring
May 24, 2026
Merged

fix/9.1: Wire RelayMessageFramer to shared Relay types#124
detain merged 1 commit into
masterfrom
fix/9.1-server-relay-wiring

Conversation

@detain
Copy link
Copy Markdown
Owner

@detain detain commented May 24, 2026

Summary

Wire RelayMessageFramer to use shared relay types from detain/phlix-shared ^0.5.0 for the multiplexed WebSocket relay protocol (Section 9.1 Phase 1).

Changes

composer.json

  • Update detain/phlix-shared constraint from ^0.4.0 to ^0.5.0
  • Add path repository for local development with symlink

src/Hub/RelayMessageFramer.php

  • Implement Phlix\Shared\Relay\RelayWireCodecInterface
  • New encode(RelayFrameType, int seq, string payload): string — binary frame encoding
  • New encodeHello(string, string): string — JSON text HELLO handshake
  • New encodeHelloAck(string, string): string — JSON text HELLO_ACK handshake
  • New decode(string): ?RelayFrame — binary frame decoding
  • Backward compatibility: frameRequest, frameResponse, framePing, framePong, parse methods retained as @deprecated for RelayConsumer (updated in Phase 0.6)

src/Hub/RelayFrame.php

  • Add type-check helpers for new protocol frame types:
    • isClientConnect() — checks for CLIENT_CONNECT frame
    • isClientDisconnect() — checks for CLIENT_DISCONNECT frame
    • isData() — checks for DATA frame
    • isHeartbeat() — checks for HEARTBEAT frame

Dependencies

Requires: detain/phlix-shared#6 (fix/9.1-shared-relay-types)

Verification

  • PHP syntax: ✅ no errors
  • Existing backward-compat tests pass with preserved parse() method
  • New protocol methods ready for RelayConsumer update in Phase 0.6

Related

  • Plan: phlix-hub/docs/ws-multiplexer-plan.md (Section 9.1 Phase 1)
  • Depends on: detain/phlix-shared#6

Update phlix-server's relay implementation to use shared types from
detain/phlix-shared ^0.5.0 for the multiplexed WS relay protocol
(Section 9.1 Phase 1).

Changes:

- composer.json: update detain/phlix-shared constraint to ^0.5.0,
  add path repository for local dev

- RelayMessageFramer.php: implement RelayWireCodecInterface, use
  shared RelayFrameType enum for new encode/decode methods. Legacy
  frameRequest/frameResponse/framePing/framePong/parse methods retained
  as @deprecated for backward compatibility with RelayConsumer (which
  will be updated in Phase 0.6)

- RelayFrame.php: add type-check helper methods for new protocol
  frame types (isClientConnect, isClientDisconnect, isData, isHeartbeat)
  using shared RelayFrameType values

Ref: phlix-hub/docs/ws-multiplexer-plan.md Section 9.1 Phase 1
@chatgpt-codex-connector
Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@detain detain merged commit 65ac67d into master May 24, 2026
0 of 12 checks passed
@detain detain deleted the fix/9.1-server-relay-wiring branch May 24, 2026 22:18
@codacy-production
Copy link
Copy Markdown

Not up to standards ⛔

🔴 Issues 1 critical · 1 high · 3 medium · 12 minor

Alerts:
⚠ 17 issues (≤ 0 issues of at least minor severity)

Results:
17 new issues

Category Results
BestPractice 2 medium
Documentation 3 minor
ErrorProne 1 medium
Security 1 critical
1 high
CodeStyle 9 minor

View in Codacy

🟢 Metrics 32 complexity · 0 duplication

Metric Results
Complexity 32
Duplication 0

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

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.

1 participant