Skip to content

SP2: reconcile SyncPlay flat wire frame-shape#339

Merged
detain merged 1 commit into
masterfrom
fix/server-sp2-syncplay-frame
Jun 29, 2026
Merged

SP2: reconcile SyncPlay flat wire frame-shape#339
detain merged 1 commit into
masterfrom
fix/server-sp2-syncplay-frame

Conversation

@detain

@detain detain commented Jun 29, 2026

Copy link
Copy Markdown
Owner

SP2: SyncPlay frame-shape reconciliation

Problem

  • Inbound: MessageHandler::handle() extracts ['data'] — flat frames have NO data key, so all fields are lost
  • Outbound: Connection::sendMessage() wraps syncplay payloads under data (deprecated Tizen envelope)
  • sendError() emits code while Messages::error() uses error_code

Fix

Inbound: Pass the whole flat message as payload for syncplay types; keep tolerant unwrap for deprecated {type,data} envelope (dashboard path unchanged)

Outbound: Build every syncplay frame with Messages::* factories and send flat via new Connection::sendFlat()

GROUP_STATE: Emit {group:{...}, your_id} flat at top level (not under data)

Error: Align sendError() to emit error_code

Files changed

  • src/Server/WebSocket/MessageHandler.php — flat dispatch + protocol_version validation
  • src/Server/WebSocket/Connection.phpsendFlat() method
  • src/Server/WebSocket/ConnectionInterface.phpsendFlat() in contract
  • src/Session/SyncPlay/SyncPlayManager.php — error_code alignment + flat GROUP_STATE
  • New tests: MessageHandlerFrameShapeTest.php, MessagesFrameShapeTest.php

Verification

  • ./vendor/bin/phpunit — 143 tests, 412 assertions ✅
  • ./vendor/bin/phpstan analyze --level=9 — no errors ✅
  • ./vendor/bin/phpcs PSR-12 — no errors ✅

Dependency

Pairs with @phlix/syncplay Phase 8 (wire-shape checkpoint)

@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.

@codacy-production

Copy link
Copy Markdown

Not up to standards ⛔

🔴 Issues 16 medium · 81 minor

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

Results:
97 new issues

Category Results
UnusedCode 2 medium
BestPractice 12 medium
Documentation 27 minor
ErrorProne 2 medium
CodeStyle 54 minor

View in Codacy

🟢 Metrics 24 complexity · 0 duplication

Metric Results
Complexity 24
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.

@detain detain merged commit 5b3c1fd into master Jun 29, 2026
11 of 14 checks passed
@detain detain deleted the fix/server-sp2-syncplay-frame branch June 29, 2026 18:05
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