Skip to content

Add append semantics via PATCH /post for non-destructive pad updates#81

Draft
Copilot wants to merge 3 commits into
mainfrom
copilot/add-append-text-mechanism
Draft

Add append semantics via PATCH /post for non-destructive pad updates#81
Copilot wants to merge 3 commits into
mainfrom
copilot/add-append-text-mechanism

Conversation

Copy link
Copy Markdown

Copilot AI commented May 13, 2026

This plugin currently only exposes replace semantics (setText) through POST /post. This change adds append semantics so callers can add content without overwriting existing pad text, while preserving create-on-missing behavior.

  • API behavior

    • Added PATCH /post route mapped to append behavior.
    • Kept existing POST /post behavior unchanged (replace via setText).
    • Reused existing upsert flow so missing pads are still created from request body for both methods.
  • Server implementation

    • Refactored route logic into a shared request handler with a method-specific mode:
      • POSTAPI.setText(...)
      • PATCHAPI.appendText(...)
    • Preserved existing request size limits, pad-id header handling, and error responses.
  • Regression coverage

    • Added frontend tests for:
      • PATCH /post appending to an existing pad.
      • PATCH /post creating a new pad when the target pad does not exist.
  • Docs

    • Updated README usage to document PATCH /post and include a curl example.
# Replace pad content
curl -X POST -d @datafile.txt -H 'X-PAD-ID: mypad' http://localhost:9001/post

# Append to existing pad (or create if missing)
curl -X PATCH -d @datafile.txt -H 'X-PAD-ID: mypad' http://localhost:9001/post

Copilot AI linked an issue May 13, 2026 that may be closed by this pull request
Agent-Logs-Url: https://github.com/ether/ep_post_data/sessions/8d85ca65-9276-4233-a94b-83d25502c051

Co-authored-by: JohnMcLear <220864+JohnMcLear@users.noreply.github.com>
Copilot AI changed the title [WIP] Add mechanism to append text to pad Add append semantics via PATCH /post for non-destructive pad updates May 13, 2026
Copilot AI requested a review from JohnMcLear May 13, 2026 10:45
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.

Feature Request: append text

2 participants