Skip to content

User Connections 0.4.0: Own migrations, PhoenixKit 3 support and recipient-only accept

User Connections 0.4.0 takes over its six tables from PhoenixKit core, so it works with PhoenixKit 3.x, and it makes sure only the person a connection request was sent to can accept or reject it.

The module owns its tables

The follows, connections and blocks tables, each with its history table, used to be created by core’s migrations. The module now has its own migration chain. Its first step adopts the tables exactly as core builds them: on an existing site every table and index is already there, so nothing changes except a version marker on the connections table. On a site whose core no longer creates the tables, the same step creates them. Rolling the chain back only rewrites the marker; it never drops a table.

The module also describes its tables for mix phoenix_kit.doctor and mix phoenix_kit.repair, so those commands can check them and recreate what is missing.

Only the recipient accepts or rejects

Before, accepting or rejecting a pending request only needed the request’s id. Now the request is re-read from the database and the person acting must be its recipient; anyone else gets {:error, :not_recipient} and nothing changes. On the My Connections page a refused attempt shows “Failed to accept request” or “Failed to reject request”.

Upgrading

The module now needs PhoenixKit 2.65.0 or later, and works up to PhoenixKit 3.x. Run mix phoenix_kit.update to apply the module’s first migration.

If your own code calls the module’s functions, accept_connection/1 and reject_connection/1 are gone. Call accept_connection(current_user, connection) and reject_connection(current_user, connection) instead; both take a connection or its uuid.

Full release notes: User Connections 0.4.0

0.4.0 · 27 October 2026

Added

  • The module supplies the manifest of its 6 tables (expected_schema/0, PhoenixKitUserConnections.ExpectedSchema), so mix phoenix_kit.repair and mix phoenix_kit.doctor check and repair them again, now from the module’s own chain instead of core’s manifest. Generated from PhoenixKitUserConnections.Migrations by core’s dev_docs/squash/generate_module_manifest.exs, never edited by hand. Core uses it from the first release after 2.64.1; before that nothing reads it. Repair is additive (it creates what is missing and reports the rest) and checks the tables only while the database is at the chain’s current version. No migration.
  • The module’s own migration chain, PhoenixKitUserConnections.Migrations (migration_module/0). V1 adopts the six tables core’s chain creates for this module, exactly as a fresh core install builds them (V135 plus V188’s unique indexes), and stamps a pkucn_schema:1 marker. Nothing changes on an existing install but the marker; from now on a change to these tables ships here instead of in core. A test proves the chain builds the tables without core (core’s PhoenixKit.TestSupport.ModuleChainCheck), with a small test database setup the suite did not have before.

Changed

  • Core pin widened to >= 2.65.0 and < 4.0.0: works with core 3.x (core 3.0 stops creating the module tables; this module’s own chain builds its tables). The floor is the first core with the file_references/0 and expected_schema/0 callbacks, which now carry @impl PhoenixKit.Module.

  • Requires phoenix_kit >= 2.22.3 and < 3.0.0 (was ~> 2.0): 2.22.3 is the first core with V188, the unique indexes the schemas name and V1 adopts.


User Connections 0.4.0. Install or update: {:phoenix_kit_user_connections, "~> 0.4"}, then mix deps.get && mix phoenix_kit.update. Full history: CHANGELOG.