Skip to content

Commit b95f448

Browse files
committed
docs(changeset): sys_comment.reactions retirement, with its migration and the operator sentence
The sibling changeset that added sys_comment_reaction said the column was unchanged in this release; both are pending stock for the same release, so that bullet now points at the retirement instead. Claude-Session: https://claude.ai/code/session_013LbZ9MhPp1iriZEtgJqioA Co-authored-by: Claude <noreply@anthropic.com>
1 parent 330fc84 commit b95f448

3 files changed

Lines changed: 36 additions & 2 deletions

File tree

‎.changeset/22566-comment-reaction-record.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@ Clause-②: yes (widening)
1414
- **Reading reactions for a feed.** Read the reactions of the comments on screen in one request, `comment_id` `$in` those ids, and group the rows by comment and emoji. Nothing is stored or computed on the comment row.
1515
- **Granting it.** The object's create, read and delete bits come from a permission set, as `sys_comment`'s do. The `everyone`-bound baseline (`member_default`) grants nothing on it.
1616
- **`@objectstack/spec`: the platform object registry lists it.** `PLATFORM_OBJECTS_BY_PACKAGE['plugin-audit']` now includes `sys_comment_reaction`, and so do `PLATFORM_PROVIDED_OBJECT_NAMES` and `isPlatformProvidedObjectName`. A stack that references the object is no longer reported as naming an unknown platform object. This is the only change in the package.
17-
- **`sys_comment.reactions` is unchanged in this release.** The column is still declared and still written by clients that write it. It is retired separately, and reactions stored in it are not converted into records.
17+
- **`sys_comment.reactions` is retired by a separate change on this line**, which carries its own entry. Reactions stored in that column are not converted into records.
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
---
2+
'@objectstack/plugin-audit': minor
3+
'@objectstack/spec': minor
4+
---
5+
6+
feat(plugin-audit)!: `sys_comment.reactions` retires; an emoji reaction lives only in `sys_comment_reaction`, and reactions stored in the old column are not migrated
7+
8+
Clause-②: no (narrowing)
9+
10+
<!-- adr-0087: registered sys-comment-reactions-column-retired -->
11+
12+
**BREAKING**, shipped as `minor` under the repo's convention for breaking changes on this line.
13+
14+
**Existing emoji reactions stored in `sys_comment.reactions` are gone after the upgrade.** They are not converted into `sys_comment_reaction` records, and no screen or API returns them again. Reactions now live in `sys_comment_reaction`, one row per comment, emoji and user, the reacting user's own record.
15+
16+
- **`sys_comment`** (`@objectstack/plugin-audit`) no longer declares `reactions`. Nothing takes its place on the comment row: no stored aggregate, and no block computed on read. Its label leaves the four generated translation bundles.
17+
- **The data door refuses the field.** A create or an update of a comment that still carries `reactions`, and a list filter on it, answer `400 INVALID_FIELD` naming the field, and nothing is written. The rest of the payload is not applied either. A read of a comment no longer returns `reactions`.
18+
- **`@objectstack/spec`**: the protocol-18 step of the ADR-0087 migration chain gains the semantic entry `sys-comment-reactions-column-retired`, so `os migrate meta` and the upgrade guide carry the prescription below.
19+
20+
**What moves for consumers.**
21+
22+
| You wrote | Write instead |
23+
|:---|:---|
24+
| `sys_comment.reactions` read as a map of emoji to user ids | one read of `sys_comment_reaction` for the comments on screen (`comment_id` `$in` their ids), grouped by comment and emoji |
25+
| an update of `sys_comment` that rewrites `reactions` to add or remove a user | create the user's own `sys_comment_reaction` row (`comment_id`, `emoji`) to react; delete that row to un-react |
26+
| `reactions` in a seed row, filter or list-view column on `sys_comment` | delete it |
27+
28+
An application that shows reactions grants `sys_comment_reaction` read, create and delete beside its `sys_comment` grant; without it a member cannot react. The console's record chatter already reads and writes `sys_comment_reaction` rows wherever the deployment declares that object, as this framework does.
29+
30+
**Existing databases — nothing moves automatically.** Schema sync is additive: the physical `reactions` column stays with the values it holds, the boot drift report names it orphaned (`sys_comment.reactions: column exists in the database but not in metadata`), and the boot is otherwise clean. The data door neither returns nor accepts the column. To drop it, run `os migrate apply --allow-destructive` with the audit plugin composed (an auth secret resolves); the stored reactions go with it.

‎packages/plugins/plugin-audit/src/objects/sys-comment.object.ts‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,11 @@ import { ObjectSchema, Field } from '@objectstack/spec/data';
5555
* `sys_comment_reaction` rows of the comments on screen (`comment_id` `$in`
5656
* their ids) and groups them by emoji. Reactions stored in the column are not
5757
* converted into records; the D3 record is the semantic entry
58-
* `sys-comment-reactions-column-retired`.
58+
* `sys-comment-reactions-column-retired`. An existing database keeps the
59+
* physical column and its values (schema sync is additive): the boot drift
60+
* report names it orphaned, the data door neither returns nor accepts it
61+
* (`400 INVALID_FIELD` on a write that names it), and
62+
* `os migrate apply --allow-destructive` drops it.
5963
*
6064
* @namespace sys
6165
*/

0 commit comments

Comments
 (0)