Bump version to 2.0.0 (breaking: reporter, supervisor and capa_owner merged into ssa, routes moved under /ssa). Add 2.0.0 release notes to docs/CHANGELOG.md. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
6.0 KiB
Changelog
All notable changes to the Setia Corporation HSE Incident Management System (IMS) will be documented in this file.
The format is based on Keep a Changelog,
and this project follows Semantic Versioning
(MAJOR.MINOR.PATCH).
How to version going forward
- PATCH (
1.1.0 → 1.1.1): small bug fixes, no new behaviour.- MINOR (
1.1.0 → 1.2.0): new features that don't break existing ones.- MAJOR (
1.x → 2.0.0): changes that break existing behaviour. Add each new release as a new## [version] - dateblock at the top, under[Unreleased].
[Unreleased]
Nothing yet.
[2.0.0] - 2026-11-06
Breaking: the Reporter, Supervisor and CAPA Owner roles are merged into one role, Site Safety Assistant (SSA). Existing sessions carry the old role, so those users must log out and in again after the deploy.
Changed
- Roles —
reporter,supervisorandcapa_ownerbecomessa. The role set is nowssa,hse,management,admin.- SSA sees incidents for their own site and their own reports, can update incidents, and works their assigned CAPAs.
- Role checks in the API, the nav, notifications (e.g. new-incident and CAPA
escalation emails) and the user manager now use
ssa. - Unknown roles fall back to the SSA navigation.
- Pages moved under
/ssa:/reporter→/ssa/my-reports,/supervisor→/ssa,/supervisor/incidents→/ssa/incidents,/capa-owner→/ssa/capas. The header search for SSA targets/ssa/incidents.
Removed
- Legacy Supabase code and dependencies:
lib/supabase/*,@supabase/ssr,@supabase/supabase-jsand thesupabase/migrations folder. The app already ran on local PostgreSQL;db/schema.sqlanddb/rls.sqlare the schema source of truth.
Affected modules
Auth and roles (lib/auth/roles.ts), navigation and shell (components/layout/*),
SSA pages (app/(protected)/ssa/*), incident, CAPA and addenda API routes,
admin user manager, email and CAPA-escalation notifications, RLS policies.
Database migrations
db/ops/2026-11-06-merge-roles-into-ssa.sql, applied by hand to production on 2026-11-06 as thepostgressuperuser (the app DB user cannot bypass RLS). One transaction: convertsreporter/supervisor/capa_ownerusers tossa, recreates theuser_roleenum asssa, hse, management, admin, recreatesauth_user_role(), then drops and re-creates all 34 RLS policies. Take apg_dumpfirst. Users with the old role in their session cookie must log out and in again.- No migration is needed for the Supabase removal.
API changes
- No endpoint was added or removed. The role value in the session and in
/api/admin/usersis nowssainstead ofreporter,supervisororcapa_owner. Creating or updating a user with any role outside the four new ones returns422 Invalid role; the default role for a new user isssa. - Page routes changed as listed under Changed.
Testing
- Log in as an
ssauser. Check/ssa,/ssa/my-reports,/ssa/incidents(site incidents only) and/ssa/capas. - Submit a new incident at
/reportand confirm it shows under My Reports. - Open an assigned CAPA and submit proof (note and photos).
- As
hseandadmin, confirm dashboards, incident lists and the user manager still work, and that the user manager offers only the four new roles. - Run
npm run testandnpm run build. Seven tests fail onmainas well (AI routes, bulk-import, email); no new failures were introduced. - In Postgres:
SELECT DISTINCT role FROM users;returns onlyssa,hse,management,admin.
Also in this version since 1.2.2 (summarised from git history)
- IMS Admin UI refresh: new tokens, Geist,
TableCard, new shells; Incidents and CAPA lists migrated. - CAPA owners submit proof with a note and photos; HSE sees a photo gallery.
- Trucks are linked to a site; the report form lists all trucks.
- AI provider switched to a local model.
[1.1.0] - 2026-07-16
Fixed
-
Auth — expired login link no longer dead-ends the user. Clicking an old Supabase magic link / email OTP redirected to a raw error URL (
error=access_denied&error_code=otp_expired&error_description=Email link is invalid or has expired).- Added graceful handling: expired or invalid links now show a friendly "This link has expired — request a new one" screen with a resend action, instead of leaving the error in the address bar.
- Increased the auth email-link / OTP expiry window in Supabase Auth settings for the testing phase.
- Verified the Supabase Redirect URL configuration points to
http://localhost:3000/...for local development.
-
CAPA — "Assigned To" owner dropdown now populates. On the Add CAPA Action screen (e.g. incident
SC1-202607-0002), the Assigned To * dropdown showed only theSelect owner…placeholder and no selectable users, blocking CAPA creation.- Ensured the user/owner source table (
profiles/users) is seeded with at least one valid user. - Added / verified a Supabase RLS
SELECTpolicy so authenticated users can read the owner list (missing policies were returning zero rows silently). - Confirmed the fetched users are mapped into
<option>elements (value= user id, label = user name) so the list renders.
- Ensured the user/owner source table (
Notes / Known operational items
- Dev server must be running for
localhost:3000to respond. If you seeERR_CONNECTION_REFUSED("localhost refused to connect"), start it withnpm run devand keep that terminal open before opening the app or clicking any email link. localhost:3000only works on your own machine during development. Production will use the deployed domain, and Supabase redirect URLs must be updated accordingly at that time.