Projects 0.1.1: Correct task counts and safer dependency changes
Projects 0.1.1 fixes the task counts on the dashboard. The todo, in progress and done totals also counted tasks in archived projects; they now count active projects only.
Other fixes:
- A template and a project can now have the same name, using the separate name indexes from PhoenixKit core’s V105 migration.
- Two people adding dependencies at the same moment can no longer create a loop. The losing change gets an error asking to retry.
- Two task status changes at the same moment can no longer mark a project completed twice.
- When a task is added from a template but its default dependencies fail to apply, a warning now says so instead of staying silent.
- Buttons that delete or change things are disabled while the action runs, so a double click does not send it twice.
- Validation errors in the summary message are translated, with readable field names.
- Failed changes are written to the activity log, marked as not completed.
Upgrading
Run mix phoenix_kit.update so core’s V105 migration is in place.
Full release notes: Projects 0.1.1
0.1.1 · 30 April 2026
Quality sweep + re-validation pass (PR #2) plus post-merge follow-up fixes (PR #2 review).
Added
Activity.log_failed/2helper that tagsmetadata.db_pending = trueso audit-feed readers can distinguish attempted-but-failed mutations from completed ones during a DB outage.@specdeclarations across the publicProjectscontext API (~32 functions) plus shared@type uuidand@type error_atom.error_summary/2translates Ecto validator messages viaGettext.dgettext/dngettextagainst theerrorsdomain, and humanizes field names in the cross-field flash summary.- Test infrastructure: full LiveView smoke-test stack
(
PhoenixKitProjects.LiveCase,Test.Endpoint,Test.Router,assign_scopehook,assert_activity_logged/2), self-contained setup migration undertest/support/postgres/migrations/, andtest.setup/test.resetmix aliases.
Changed
Activity.log/2rescue widened to the canonical post-Apr shape (Postgrex.Error -> :ok,DBConnection.OwnershipError -> :ok,e -> Logger.warning,catch :exit, _ -> :ok).enabled?/0gainedcatch :exit, _ -> falsefor sandbox-shutdown resilience.recompute_project_completion/1now wraps the read + check + update in a transaction so two concurrent assignment status changes can’t double-mark a project completed.add_dependency/2runs the cycle check + insert in a:serializabletransaction; concurrent edge inserts that would close a cycle now fail with a friendly retry-hint changeset error.create_project_from_template/2opens its outer transaction at:serializableso the cycle-race protection insideadd_dependency/2actually applies on the template-cloning path (Postgres ignores isolation level on nested transactions).- All 5 admin LiveViews emit
Logger.debugonhandle_infocatch-alls (was silent). phx-disable-withon every destructivephx-clicksite (project_show_live× 9,assignment_form_live× 3,task_form_live× 2, delete buttons inprojects_live/tasks_live/templates_live).Project.changeset/2name_index_for/2picks the partial-index constraint name based onis_template, so a template and a project can share a name freely. Coercion accepts the full set of truthy forms (true,"true","1",1,"on").- Cross-module schema typespecs relaxed to
struct() | niluntilphoenix_kit_staff0.1.1 ships@type tdeclarations (tracking:BeamLabEU/phoenix_kit_staff#3).
Fixed
add_dependency/2was TOCTOU under concurrent inserts (PR #1 review #2).assignment_status_counts/0was filtering onis_template == falsebut notstatus == "active", inflating the dashboard’s todo / in_progress / done totals with archived projects’ assignments (PR #1 review #4).- Template + project name unique-constraint collision via core’s V105 partial-index split (PR #1 review #5).
apply_template_dependencies/1rollback no longer silently swallowed — surfaces a:warningflash + Logger.warning (PR #1 review #6).do_update_progress/3,save_duration, andremove_dependencyinProjectShowLivenow route their error branches throughActivity.log_failed/2, closing thedb_pending: trueinvariant gap surfaced by the PR #2 review.test_helper.exsno longer hard-fails whenpsqlis missing — the reachability probe falls through to the connect-attempt path, matching the AGENTS.md “never hard-fail on a missing DB” contract.
Coverage / quality
- Test count: 56 → 355 (+299), 0 flakes across 10/10 stable runs.
- Line coverage: 37.02% → 91.80%.
- Dialyzer: 6 pre-existing unknown-type warnings → 0 errors.
- Credo
--strict: 0 issues.
Projects 0.1.1. Install or update: {:phoenix_kit_projects, "~> 0.1"}, then mix deps.get && mix phoenix_kit.update. Full history: CHANGELOG.