Skip to content

Peer broadcast relay is incomplete: /yoyo/broadcast always 404, broadcastMessage() only relays POST #70

Description

@davidchatting-bot

Where

`onYoYoMessagePOST()` in `src/YoYoWiFiManager.cpp`:
```cpp
if (message["path"] == "/yoyo/broadcast") {
//TODO: request to broadcast a message from a peer - 404 unless YY_MODE_PEER_SERVER
request->send(404);
result = 404;
}
```

`broadcastMessage()`, which relays a message out to every peer:
```cpp
for (int i = 0; i < peerCount; i++) {
getPeerN(i, ipAddress, NULL);
if(message["method"] == "POST") POST(ipAddress -> toString().c_str(), message["path"], message["payload"]);
//TODO: consider the other method types
}
```

Problem

  • `/yoyo/broadcast` is entirely unimplemented - always 404, regardless of mode.
  • `broadcastMessage()` (used internally by `processBroadcastMessageList()` in `YY_MODE_PEER_SERVER`) only relays messages whose `method` is `"POST"` - GET/DELETE messages added to `broadcastMessageList` would silently never be relayed to peers.

Ask

  • Implement the `/yoyo/broadcast` endpoint per its intended purpose (per the comment: allow a peer, not just the local device, to request a broadcast - 404 unless in `YY_MODE_PEER_SERVER`).
  • Extend `broadcastMessage()` to relay GET/DELETE the same way it does POST, using the existing `GET()`/DELETE equivalents, or explicitly document that broadcast is POST-only if that's intentional.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions