Skip to content

feat(ws): add task.deliver receive, task.started emission, and queue integration#183

Merged
iAziz786 merged 1 commit intomainfrom
ws-push-task-delivery
Apr 28, 2026
Merged

feat(ws): add task.deliver receive, task.started emission, and queue integration#183
iAziz786 merged 1 commit intomainfrom
ws-push-task-delivery

Conversation

@iAziz786
Copy link
Copy Markdown
Contributor

Summary

Extend the Hostlink WebSocket client from handshake-only traffic to full task delivery receipt, started acknowledgements, and local queue integration.

Changes

  • wsprotocol.TaskDeliverPayload added with command/priority fields and validation.
  • localtaskstore.ReceiptStore interface extended with RecordStarted.
  • wsclient.Client gains TaskEnqueuer and ReceiptStore:
    • receiveTaskDeliver: decodes payload, consults durable state, records receipt, sends task.received, enqueues only for new attempts. Running duplicates reply with task.started; final duplicates resend unacked terminal.
    • SendStarted: persists running state, sends task.started envelope.
  • taskjob.ResultChannel extended with SendStarted. Called after execCmd.Start() — kill-and-fallback to HTTP if start fails.
  • TaskJob.Enqueue adds in-memory buffered channel worker, wired as WS TaskEnqueuer in main.go.

Test cases added

  • New delivery: recorded, received sent, queued once.
  • Running duplicate: started sent, not requeued.
  • Received duplicate: re-acked, not requeued.
  • Final duplicate: unacked terminal replayed, not requeued.
  • SendStarted: state persisted as running, envelope sent.
  • TaskJob: verifies started emission on successful start.

@iAziz786 iAziz786 merged commit 266c7ff into main Apr 28, 2026
1 check passed
@iAziz786 iAziz786 deleted the ws-push-task-delivery branch April 28, 2026 05:37
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