Skip to content

v0.5.111

Choose a tag to compare

@jaspertey jaspertey released this 30 Oct 17:30
15d6e41

Upgrading

  • Run kit:update plan|apply for session-ui (re-pinned sha256:f971fe6c…8bbf → sha256:fc7b37a9…9705): 0001_01_02_000501_add_user_foreign_key_to_kit_security_events_table.php and 0001_01_02_000503_add_user_foreign_key_to_kit_user_state_table.php take the type fix below. It's a type-only change, so there's nothing to migrate: a host that already ran them keeps its schema, and kit:update plan's note that a changed migration won't reach the database needs no action here.
  • Run kit:update plan|apply for workspace-ui (re-pinned sha256:a6ece558…cfdd → sha256:c73301ca…1890): Workspace/Placeholder/Page.vue, Workspace/Settings/Placeholder/Page.vue and Workspace/Settings/People/Page.vue take the type fix below. No behaviour changes.
  • Run kit:update plan|apply for workspaces (re-pinned sha256:40fdd76c…81c4 → sha256:56912cc3…eafd) and session-ui (re-pinned sha256:fc7b37a9…9705 → sha256:e0286318…10a2), then php artisan migrate: the new 0001_01_02_000210_add_deleting_at_to_kit_workspaces_table (nullable deleting_at and deleting_by on workspaces, recorded as kit-added on an adopted table) and 0001_01_02_000504_create_kit_account_deletions_table migrations below. Existing workspaces stay open. Nothing changes for a host whose purge handler doesn't opt into deferral.

Added

  • Deferred workspace and account deletion (docs/lifecycle-events.md › Deferred deletion). A purge handler that also implements Tey\Kit\Features\Workspaces\Contracts\DefersWorkspacePurge (or Tey\Kit\Features\SessionUi\Contracts\DefersAccountPurge) is no longer run inside the request's transaction. The kit closes the workspace at once (deleting_at), dispatches WorkspaceDeleting, writes a workspace.deletion_started audit row, and after the commit calls the handler's begin() to queue the host's job. That job purges in its own chunks and ends with app(FinishWorkspaceDeletion::class)($workspaceId), which deletes the kit's and Concierge's rows in one short transaction and dispatches WorkspaceDeleted. The hook is idempotent (a second call returns false) and refuses a workspace that isn't being deleted (workspace_not_deleting). A closed workspace refuses every member's admission (workspace_deleting, 403), takes no invitation or people change, is hidden from the switcher and lists, and sends its members from its pages to the workspace list with a "being deleted" notice. It's never reopened. Accounts work the same way: the account is closed at once (workspaces left, Concierge account deactivated so sign-in is refused, database sessions ended, Passport tokens revoked and Sanctum tokens deleted), then app(FinishAccountDeletion::class)($userId) deletes it. The synchronous mode stays the default and is unchanged. composer test:lifecycle-pages covers both modes.

Fixed

  • session-ui's user foreign key migrations pass a host's PHPStan. 000501 and 000503 typed user() as a bare array (missingType.iterableValue) and built the user model with new (config(...)), an object without getTable() or getKeyName() (method.notFound): six errors at level 7 in a host that analyses database/. user() now returns array{string, string}, and the configured class is read as class-string<Model>. The model is built and read exactly as before. A new composer test:phpstan-stubs (bin/phpstan-stubs.sh, a CI step) analyses every PHP stub, with .stub dropped, at PHPStan level 8 against the kit's vendor.
  • workspace-ui's pages type-check on vue-tsc 2. The Placeholder pages and Settings › People cast to an inline object type in the template (as { label: string; url: string }[]), which vue-tsc 2 can't parse (TS1005). Each page now names the type in <script setup> and casts to that name. The components type-check (bin/typecheck-components.sh, CI's vue-tsc job) now covers every Vue and TypeScript file a feature installs into resources/js (each feature.json files entry, at its installed path), not only core's components and the guest pages, and runs on vue-tsc 2.2.12 (installed as vue-tsc-2) as well as 3, each against Inertia 3.9.1 and 3.7.1.

What's Changed

  • Type session-ui's user FK migrations and workspace-ui's template casts for host checkers (0.5.x) by @jaspertey in #495
  • Add deferred workspace and account deletion (0.5.x) by @jaspertey in #504
  • Release v0.5.111 by @jaspertey in #511

Full Changelog: v0.5.110...v0.5.111