Skip to content

Commit 47cbb88

Browse files
committed
chore(changeset): objectql patch for droppedFields on a create naming no organization (#21682)
Claude-Session: https://claude.ai/code/session_017ErfyP2Rx7XWHJA27QjyUi Co-authored-by: Claude <noreply@anthropic.com>
1 parent 81ad21e commit 47cbb88

1 file changed

Lines changed: 22 additions & 0 deletions

File tree

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
---
2+
'@objectstack/objectql': patch
3+
---
4+
5+
`droppedFields` on a create names only keys the caller sent, never a value a write middleware filled in
6+
7+
Clause-②: no
8+
9+
With `@objectstack/organizations` mounted (the walled tenancy postures), a non-system create that names no `organization_id` has that column filled with the caller's active organization by the organizations write middleware. `ObjectQL.insert` took its record of what the caller sent after that middleware had run. So the static `readonly` strip treated the fill as a caller write, took it, and reported it:
10+
11+
- Before: `POST /api/v1/data/<object>` with a body that names no `organization_id` answered 201 with `droppedFields: [{ object, fields: ['organization_id'], reason: 'readonly' }]`. `onFieldsDropped` fired with the same event. The console showed it as a warning toast on every such create.
12+
- After: the same create answers 201 with no `droppedFields`, and `onFieldsDropped` does not fire. The row is stored in the active organization, as before.
13+
14+
`insert` now records which keys each row carries before any write middleware runs. Only those keys count as sent by the caller. No field is exempted by name, so this covers every write middleware fill, including the `owner_id` fill of `@objectstack/plugin-security`. The referential-integrity check reads the same record, so it no longer checks a middleware-filled reference as if the caller had sent it.
15+
16+
Unchanged:
17+
18+
- A key the caller does send is judged and reported as before. That includes `organization_id` itself, and a key whose value a middleware rewrote.
19+
- The array insert (`createMany`) and the `single` posture already reported nothing for an absent `organization_id`, and they still do.
20+
- The stored row is the same. Before, the filled column was stripped and then filled again from the same active organization further down. Now the fill is kept.
21+
22+
No export, type, error code or status changes.

0 commit comments

Comments
 (0)