fix: preserve week-long sessions and add profile mascot
This commit is contained in:
1 parent
4e71e9b797
commit
40f24cf5f7
18 files changed
+240
-25
No files matched your search
@@ -1,3 +1,28 @@
|
||||
# Session Persistence
|
||||
|
||||
Logged-in sessions have a seven-day maximum lifetime and seven-day inactivity
|
||||
timeout (`[auth.sessions]` timebox/inactivity_timeout `168h`). The browser keeps
|
||||
its Supabase session in persistent storage and refreshes tokens automatically;
|
||||
users do not need to sign in when an access token expires. Multiple devices are
|
||||
allowed. Logout, changed passwords, revoked sessions or cleared browser storage
|
||||
still require authentication. Limits take effect when refresh is attempted, not
|
||||
by invalidating an already-issued JWT immediately.
|
||||
|
||||
On production, set `GOTRUE_SESSIONS_TIMEBOX=168h`,
|
||||
`GOTRUE_SESSIONS_INACTIVITY_TIMEOUT=168h` and
|
||||
`GOTRUE_SESSIONS_SINGLE_PER_USER=false` on the existing Auth container. Preserve
|
||||
the other runtime settings, signing keys, SMTP and image. The deployed JWT expiry
|
||||
remains 86400 seconds; session lifetime and JWT lifetime are separate settings.
|
||||
The repository's local JWT expiry remains its existing configured value.
|
||||
|
||||
Migration `20261010183614_preserve_sessions_on_unchanged_ticket` prevents the
|
||||
Pretix `_ensure_auth_user` helper from revoking sessions during unchanged imports.
|
||||
It locks the user and checks the existing password hash before updating it.
|
||||
Actual password changes continue to revoke sessions. Existing sessions that were
|
||||
already deleted cannot be restored; those users need to sign in once.
|
||||
|
||||
See [release record](../releases/2026-10-10.md#follow-up-deployments) for the
|
||||
production backup, verification and deployment boundaries.
|
||||
# Supabase Core — Local Stack
|
||||
|
||||
The Supabase core is a set of Docker containers managed by the **Supabase CLI**
|
||||
|
||||
@@ -1,3 +1,21 @@
|
||||
# Session Persistence Regression
|
||||
|
||||
Run the rollback-only fixture after applying
|
||||
`20261010183614_preserve_sessions_on_unchanged_ticket`:
|
||||
|
||||
```sh
|
||||
docker exec -i supabase_db_Convivo psql -X -U postgres -d postgres \
|
||||
-v ON_ERROR_STOP=1 < supabase/tests/session_persistence_tests.sql
|
||||
```
|
||||
|
||||
It verifies unchanged repeated imports preserve the existing password hash and
|
||||
session, changed ticket passwords revoke sessions, and admin password precedence
|
||||
survives ticket changes. No fixture accounts remain after rollback.
|
||||
|
||||
The production Auth policy was additionally verified with a disposable confirmed
|
||||
test account: actual refresh succeeded at six days, failed after the seven-day
|
||||
lifetime, and failed after eight-day inactivity. Cleanup removed the test account;
|
||||
no real email was sent. See [release record](../releases/2026-10-10.md#follow-up-deployments).
|
||||
# Backend — RPC Test Suite
|
||||
|
||||
A self-contained, idempotent test suite for the transactional points RPCs, role
|
||||
|
||||
@@ -293,6 +293,10 @@ event). The `leaderboard` table is kept in sync transactionally by the RPCs —
|
||||
|
||||
## Profile
|
||||
|
||||
- **Manfred** — a compact mascot beside the title uses one of four transparent
|
||||
WebP poses from `apps/convivo/public/manfred`. A pose is selected randomly each
|
||||
time Profile mounts, including returning from another tab or refreshing; it
|
||||
stays stable during edits. Random selection can repeat the previous pose.
|
||||
- **Header** — avatar, name, email, registration-type pill, a **staff** pill
|
||||
(only when `contact.is_admin` **and** the type isn't already `staff`, so it
|
||||
never shows twice), and a points pill.
|
||||
|
||||
@@ -90,6 +90,51 @@ blindly or remove a merge mapping after users have merged real tickets.
|
||||
deployment. Shared authenticated-browser inspection was unavailable; API-mocked
|
||||
browser tests and direct production checks were used instead.
|
||||
|
||||
## Follow-up Deployments
|
||||
|
||||
- QR-only login hint: `entryLabel` and `placeholder` now say `QR Code`, with
|
||||
existing admin-email magic-link behavior unchanged. Attendee-only deployment
|
||||
backup: `qr-hint-20261010T113838Z`; 31 API-mocked production tests passed.
|
||||
- Profile Manfred easter egg: four transparent 224px WebP poses appear beside
|
||||
the Profile title at 76px. Random choice occurs on each mount, including tab
|
||||
re-entry and refresh, and remains stable during edits. Choices may repeat.
|
||||
Original artwork is retained in `Manfred/`; optimized assets live in
|
||||
`apps/convivo/public/manfred/`. Backup: `manfred-20261010T114633Z`.
|
||||
All 33 login/profile production-bundle tests passed, including 360px/1280px
|
||||
image loading, layout and lifecycle checks. Only the attendee app restarted.
|
||||
- Public asset deployment requires directory mode `755` and file mode `644`.
|
||||
Restrictive transfer permissions initially caused 403s; source permissions
|
||||
were corrected and the image rebuilt. Nginx Proxy Manager cached those errors
|
||||
for 30 minutes. Only cache entries matching the four new image URLs were
|
||||
invalidated, checking both the MD5 filename and embedded cache key. The proxy
|
||||
was not restarted and unrelated cache entries were not removed.
|
||||
- Seven-day sessions: migration
|
||||
`20261010183614_preserve_sessions_on_unchanged_ticket` is installed with a
|
||||
migration-ledger entry. Pretix's password helper previously rehashed unchanged
|
||||
passwords and deleted sessions every sync. It now locks the user, compares the
|
||||
supplied password against the existing hash, and only rewrites the password
|
||||
and revokes sessions when the effective password actually changes.
|
||||
- Auth now uses `GOTRUE_SESSIONS_TIMEBOX=168h`,
|
||||
`GOTRUE_SESSIONS_INACTIVITY_TIMEOUT=168h`, and
|
||||
`GOTRUE_SESSIONS_SINGLE_PER_USER=false`. Persistent session config is aligned.
|
||||
This is a refreshable session lifetime, not a week-long JWT. Existing
|
||||
production JWT expiry (`86400` seconds), issuer/signing keys, SMTP, redirects,
|
||||
image and container settings were preserved. Only Auth restarted; other
|
||||
container IDs/start times were unchanged. Backup:
|
||||
`week-sessions-20261010T183742Z`, including the database, previous config and
|
||||
private Auth inspect, plus the retained rollback Auth container.
|
||||
- Three rollback-only password-sync checks passed locally and in production.
|
||||
Actual Auth refresh requests using a disposable confirmed test account accepted
|
||||
a six-day-old inactive session and rejected both an expired seven-day lifetime
|
||||
and eight-day inactivity. The account was deleted in cleanup; no real email
|
||||
was sent. Existing users may need to sign in once if an earlier sync already
|
||||
revoked their session. Clearing browser storage, explicit logout, password
|
||||
changes or other security revocations still require sign-in. Limits are checked
|
||||
on refresh, so an already-issued JWT can remain valid until its own expiry.
|
||||
- Final combined validation passed: both frontend builds, nine importer tests,
|
||||
browser-test TypeScript and all 37 API-mocked production-bundle login, profile
|
||||
and ticket-merge checks.
|
||||
|
||||
## Credential Handling
|
||||
|
||||
The private SMTP instructions are ignored by Git. Earlier diagnostic output
|
||||
|
||||
Reference in new issue
Block a user