Skip to content

Dev - #1

Open
ArnabChatterjee20k wants to merge 24 commits into
mainfrom
dev
Open

Dev#1
ArnabChatterjee20k wants to merge 24 commits into
mainfrom
dev

Conversation

@ArnabChatterjee20k

Copy link
Copy Markdown

No description provided.

@greptile-apps

greptile-apps Bot commented Aug 27, 2026

Copy link
Copy Markdown

Greptile Summary

The latest changes add MQTT PUBLISH duplicate-delivery flag support and a reusable two-byte integer reader.

  • Adds DUP encoding to the MQTT 3.1.1 and 5.0 PUBLISH builders without breaking existing positional calls.
  • Adds DUP decoding and big-endian 16-bit integer reading to Packet.
  • Adds unit coverage and README examples for the new packet behavior.

Confidence Score: 5/5

The PR appears safe to merge; no actionable new failures remain, and all previous findings were manually resolved.

The DUP implementation preserves existing call signatures and produces correct flags for supported QoS values, while the new integer reader has no current production parsing path. Every previous Greptile thread was manually resolved without explanation.

Important Files Changed

Filename Overview
src/Mqtt/Packet.php Adds DUP-flag decoding and a big-endian 16-bit reader with focused unit coverage.
src/Mqtt/Packet/V3.php Adds an optional trailing DUP argument and correctly assembles valid MQTT 3.1.1 PUBLISH flags.
src/Mqtt/Packet/V5.php Adds backward-compatible DUP support to MQTT 5.0 PUBLISH encoding.
tests/unit/PacketTest.php Covers DUP round trips, QoS 0 masking, and valid 16-bit reads.
README.md Documents the new DUP API and packet-reading primitive.

Reviews (10): Last reviewed commit: "document the DUP flag and readInt16 in t..." | Re-trigger Greptile

Comment thread src/Mqtt/Client.php
Comment thread src/Mqtt/Adapter/Swoole.php Outdated
Comment thread .github/workflows/tests.yml Outdated
Comment thread src/Mqtt/Client.php
Comment thread src/Mqtt/Adapter/Swoole.php Outdated
Comment thread src/Mqtt/Adapter/Swoole.php Outdated
The adapter pins worker_num to 1, so a single process holds every
connection and a plain array is a complete view. Apps that scale
workers keep their own authoritative connection state (as the Appwrite
MQTT messaging adapter does), so the transport list is a local
convenience — no need for a Swoole\Table's cross-worker guarantee.
Comment thread .github/workflows/tests.yml
The transport is a byte pipe: start/shutdown/send/close plus the
lifecycle hooks. It no longer tracks which fds are connected — an
application that needs that keeps its own map, learning of a client
from the CONNECT packet (onReceive) and of a drop from onClose, keyed
by whatever domain state it attaches to each fd. Removes getConnections
from the Adapter contract, the Swoole registry, and the Server wrapper.
outputs: type=cacheonly discarded the image that load: true and the
mqtt-<php>-dev tag were meant to export, so docker compose up rebuilt
it from scratch on every job. Drop the cacheonly output; the image is
now loaded and compose reuses it, while cache-from/cache-to still warm
the gha layer cache.
Comment thread composer.lock Outdated
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