Skip to content

01a0e8d5 - Let moderators edit shop notes and mark shop pins - #326

Draft
TaprootFreakAI wants to merge 19 commits into
developfrom
feat/01a0e8d5-shop-note-edit
Draft

TaprootFreakAI wants to merge 19 commits into
developfrom
feat/01a0e8d5-shop-note-edit

Conversation

@TaprootFreakAI

@TaprootFreakAI TaprootFreakAI commented Sep 28, 2026 •

Copy link
Copy Markdown
Collaborator

EN:
Moderators can change a live shop note at any time: the text, the place, the linked account, and the stills.
The places list says which pins are shop notes, so the map shows the pencil only there.
A real change of text, place, or account is stored with who did it and when, while replacing photos does not write a history row and does not replace the signed Nostr event.
Sunday still refuses those writes, stills can be cleared, and a video on the note stays.

DE:
Moderatoren können einen offenen Shop-Eintrag jederzeit ändern: den Text, den Ort, das verknüpfte Konto und die Standbilder.
Die Ortsliste sagt, welche Pins Shop-Einträge sind, damit die Karte den Bleistift nur dort zeigt.
Eine echte Änderung von Text, Ort oder Konto wird mit Person und Zeitpunkt gespeichert, während neue Bilder keine Historie schreiben und das signierte Nostr-Event nicht ersetzen.
Am Sonntag bleiben diese Schreibvorgänge gesperrt, Standbilder können entfernt werden, und ein Video am Eintrag bleibt.

Details

PATCH /messages/:id/text replaces the body of a live top-level #21GiftsShop note. The shop tag is kept or put back. Replies, hidden notes, and notes that are not shop notes are refused.

PATCH /messages/:id/photos replaces the stills. An empty list clears them. The new stills are written before leftover extras are removed, so a failed extra insert does not clear the gallery first. The write then reads the note again, because one statement cannot see its own update. The video, the sats, the author, and the signed event id stay as they are. This write does not append message_edit.

GET /messages/:id/edits returns { edits: [{ id, createdAt, field, before, after, actor }] } newest first, including a hidden shop note. field is text, place, or shopAccount. A live note that is not a shop note returns 404, the same as a missing note. Place and shop-account saves append a row only when the stored value actually changes. The same account id is not a new assignment when only the username or display name differs.

GET /messages/places includes shop. It is true when the note text contains the shop tag, and false otherwise. That does not change who may edit.

A hard delete drops the edit history of that note and its direct replies in the in-memory store as well. Postgres already removes those rows with the note.

Creating a shop note stores the account first. The one-time place push still runs on that saved note.

@TaprootFreakAI
TaprootFreakAI force-pushed the feat/01a0e8d5-shop-note-edit branch from 975305f to 938ebf9 Compare September 28, 2026 18:51
@TaprootFreakAI TaprootFreakAI changed the title 01a0e8d5 - Let moderators edit shop notes 01a0e8d5 - Let moderators edit shop notes and mark shop pins Sep 28, 2026
@TaprootFreakAI

Copy link
Copy Markdown
Collaborator Author

EN:
Ready after 4 review passes.
Moderators can edit the text, place, account, and stills of a live shop note, and the places list marks shop pins.

DE:
Bereit nach 4 Review-Durchläufen.
Moderatoren können Text, Ort, Konto und Bilder einer lebenden Shop-Notiz ändern, und die Ortsliste markiert Shop-Pins.

Details

Quality and logic review on 626c1ae reported no findings. The operator waived the additional review lane for this pull request. The test check on that commit succeeded, and the pull request merges cleanly onto develop.

@TaprootFreakAI
TaprootFreakAI marked this pull request as ready for review September 28, 2026 21:30
@TaprootFreakAI
TaprootFreakAI marked this pull request as draft September 29, 2026 08:05
@TaprootFreakAI
TaprootFreakAI force-pushed the feat/01a0e8d5-shop-note-edit branch 4 times, most recently from 005988d to 9fbb0b5 Compare September 30, 2026 06:34
Staff at moderator rank or higher can replace the text of a live
top-level shop note at any time. Place and shop-account changes are
recorded in the same history. The signed Nostr event stays as published.
A new top-level shop note can name a 21.gifts user. The first assignment is not edit history.
A moderator can clear or replace the photos. The video, the sats, and
the published event stay as they are.
The places list says which notes are shops. Pins that are not shops stay without the pencil.
A text value that happens to be JSON stays a string. The contract lists the new shop routes.
The schema note no longer says the unwrap block is last.
A failed extra insert no longer clears the gallery first.
Saving the same shop words without #21GiftsShop restores the tag and writes no history row. The existing test only sent the tag already in place.
A bad id is 404, not 400. The test name said 400 and never checked the error text.
Postgres removes edit rows by cascading from the note. The schema test named the table and never locked that rule.
A missing note is not found before a shop name is looked up. Create, photos, and history say the same.
@TaprootFreakAI
TaprootFreakAI force-pushed the feat/01a0e8d5-shop-note-edit branch from 9fbb0b5 to 0f1c82a Compare September 30, 2026 07:40
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