Skip to content

Commit 5c5d9b3

Browse files
committed
docs(objectql): say what the atomicity plan's twin test changes, as measured
On the showcase the plan still reaches the federated object through its injected owning_business_unit_id at depth 1, so its verdict for an organization delete stays cross-datasource. The comments and the changeset now claim only that the plan keeps the scan's participant test. Claude-Session: https://claude.ai/code/session_017ErfyP2Rx7XWHJA27QjyUi Co-authored-by: Claude <noreply@anthropic.com>
1 parent 8a15848 commit 5c5d9b3

3 files changed

Lines changed: 7 additions & 8 deletions

File tree

‎.changeset/21910-cascade-federated-tenant-anchor.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@ Deleting an organization no longer fails with a 500 on a deployment that has a f
77
Clause-②: no
88

99
- **What was wrong.** The registry injects `organization_id` into every object, federated ones included, and the platform provisions no storage for a federated object. The cascade's dependents probe filtered the remote table on that column, the SQL driver refused the unknown column (`INVALID_FILTER`), and the probe's failure propagated, so the delete failed. The showcase, with its federated fixture provisioned, answered every organization delete with 500.
10-
- **What changed.** The cascade scan skips a federated object's injected tenant anchor. It asks the same `isFederatedObject` predicate as the driver-option builder and the related-record read, plus the injected-column provenance marker, so an `organization_id` the author declared on a federated object is still probed. The cascade's atomicity plan asks the same question, so an organization delete on such a deployment now runs as one transaction instead of being reported as a cross-datasource cascade.
10+
- **What changed.** The cascade scan skips a federated object's injected tenant anchor. It asks the same `isFederatedObject` predicate as the driver-option builder and the related-record read, plus the injected-column provenance marker, so an `organization_id` the author declared on a federated object is still probed. The cascade's atomicity plan asks the same question, so it keeps counting exactly the relations the scan probes.
1111
- **What did not change.** Any lookup an author declares on a federated object is still probed, and a probe that cannot run still fails the delete. Only a missing child table is passed over as having no dependents.

‎packages/objectql/src/engine.ts‎

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15858,11 +15858,10 @@ export class ObjectQL implements IObjectQLEngine {
1585815858
try { resolvedRef = this.resolveObjectName(ref); } catch { resolvedRef = undefined; }
1585915859
if (ref !== name && resolvedRef !== name) continue;
1586015860
// [#21910] The scan skips a federated object's injected tenant
15861-
// anchor, so this walk does too, and the participant set stays the
15862-
// scan's. Counting it read every organization delete on a deployment
15863-
// with a federated object bound as cross-datasource (`'split'`): the
15864-
// cascade ran unwrapped, and the warning named a datasource the
15865-
// cascade never touches.
15861+
// anchor, so this walk does too: the participant test stays the
15862+
// scan's own, as the comment above requires. A federated object this
15863+
// walk still reaches through any other relation keeps the verdict
15864+
// `'split'`, because the scan probes that relation.
1586615865
if (isFederatedInjectedTenantAnchor(child, fieldName)) continue;
1586715866
out.push(childName);
1586815867
break;

‎packages/objectql/src/federated-object.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ export function isFederatedObject(schema: unknown): boolean {
5151
* - `ObjectQL.cascadeDeleteRelations` does not probe the remote table on it
5252
* (the probe was refused as an unknown column, and every organization
5353
* delete answered 500);
54-
* - `ObjectQL.planCascadeAtomicity` does not count the federated object as a
55-
* participant on another datasource.
54+
* - `ObjectQL.planCascadeAtomicity` does not count that column as making the
55+
* federated object a participant, so its participant test stays the scan's.
5656
*
5757
* Three conjuncts, and each one is the narrowing:
5858
*

0 commit comments

Comments
 (0)