You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit c10fd4a
Browse filesBrowse the repository at this point in the historyBrowse files
fix(objectql): a refused first install leaves nothing of itself, even over a tenant's object
Every registerApp body now runs through the registry's restore on refusal,
first installs included, so a first install refused part-way leaves no record,
object, item or namespace of itself, and a tenant's object, its overlay or
another package's extension it layered over reads as before. The separate
uninstall-based path for first installs is gone; the boot seed is untouched.
Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FEkQ5oL2i4xH7Mu7va3kxr
fix(objectql): a refused first install leaves nothing of itself, even over a tenant's object
9
+
10
+
A first install of a package that `ObjectQL.registerApp` refuses part-way now leaves nothing of itself registered in every case, including when the package layers over an object a tenant already holds (with or without the tenant's own overlay), over an overlay with no owner, or over another package's extension of one of its objects. Afterwards there is no package record, object, extension, app, item, picklist extension, namespace, navigation contribution, contributed kind or datasource definition of the package, and the tenant's object, its overlay and the other package's extension read exactly as before the attempt. A persisted "disabled" state for that id still applies to its next install. What is refused, and every refusal's code, status and words, is unchanged.
11
+
12
+
Every registration is now put back by the registry itself when it is refused, the way a refused upgrade already was. This supersedes the line of the pending `28697-refused-registration-leaves-nothing` changeset saying the engine passes `{ keepBootSeed: true }` to `SchemaRegistry.uninstallPackage`: the engine no longer uninstalls a refused first install. The option itself stays available and unchanged.
import { assertAggregatedColumnsAreDistinct, assertDateBucketTargetsAreTemporal } from './aggregate-query-shape-door.js';
333
333
import { applyProtection, pluralToSingular, ExternalWriteForbiddenError } from '@objectstack/spec/shared';
334
-
import { SchemaRegistry, computeFQN, type ArtifactInstallScope } from './registry.js';
335
-
// [#28697] Whether an object's sitting owner is a tenant's own (ADR-0029 D9.6),
336
-
// asked by `refusedRegistrationWithdrawable` before a refused body is withdrawn.
337
-
import { isTenantAuthored } from '@objectstack/metadata-core';
334
+
import { SchemaRegistry, type ArtifactInstallScope } from './registry.js';
338
335
import { expandSearchToFilter, normalizeSearch, SEARCHABLE_ENUM_TYPES, SEARCHABLE_TEXTUAL_TYPES } from './search-filter.js';
339
336
import { stripSearchCompanion } from './search-companion.js';
340
337
import { ExpressionEngine, analyzeRelationshipTraversals, isUnparseableDate, type EvalError, type EvalOptionLabels, type EvalPermissions } from '@objectstack/formula';
@@ -5176,65 +5173,6 @@ export function assembledViewItemRefusal(
5176
5173
return err;
5177
5174
}
5178
5175
5179
-
/**
5180
-
* [#28697] Whether a refused {@link ObjectQL.registerApp} of package `id` may
5181
-
* be withdrawn through the registry's uninstall, asked BEFORE anything of the
5182
-
* body is written. True only when withdrawing takes back exactly what the
5183
-
* refused call wrote and nothing else:
5184
-
*
5185
-
* - no package record answers `id` yet. A refused re-register of an
5186
-
* installed id is NOT withdrawn: the uninstall would take the installed
5187
-
* version with it;
5188
-
* - `id` is not the owner a stack's residual registers its items under
5189
-
* (`recordResidualOwner`), whose items no package record covers;
5190
-
* - no object the body or a nested plugin owns, nor any object it extends,
5191
-
* already holds a contribution under `id`;
5192
-
* - every object the body or a nested plugin owns is either unheld or owned
5193
-
* by another code package (which `registerObject` refuses before it adds
5194
-
* anything). A tenant-authored owner or an overlay or extension with no
5195
-
* owner is left alone: `registerObject` re-classifies the tenant
5196
-
* contribution as the package's overlay, and the uninstall drops an
5197
-
* object's overlay with its owner (ADR-0029 D9.7) and refuses an object
5198
-
* another package extends, so withdrawing would lose the tenant's layer in
5199
-
* this process or be refused.
5200
-
*/
5201
-
export function refusedRegistrationWithdrawable(
5202
-
registry: SchemaRegistry,
5203
-
id: string | undefined,
5204
-
manifest: any,
5205
-
residualOwners: ReadonlyMap<string, unknown>,
5206
-
): boolean {
5207
-
if (!id || registry.getPackage(id) !== undefined || residualOwners.has(id)) return false;
5208
-
// The object names as the registry files them (`computeFQN`, the call
5209
-
// `registerObject` makes with the namespace each one registers under).
0 commit comments