Questify

3.16.0

Released

Fixes

  • Missed days of a recurring Quest no longer read as Active. On cards, rows and the quest page a cycle closed unfinished shows Missed (one you marked failed still shows Failed), and a cycle that has not started yet shows Upcoming. The dashboard's Active quests tile and completion rate now count only cycles you can still work on, the /quests Failed chip counts missed cycles so All adds up, and /tasks opened with no quest prefers any other active quest to a cycle whose day is over (#1039).

Technical changes· 15 entries for database, tooling, CI, tests and docs

Database

  • Recurring Quest cycles now end. A cycle nobody finished is closed as failed with the new quests.lapsed_at once its day is over: at the later of local midnight in its timezone and the end of its window, for every cadence, the way Today already treats it. close_lapsed_recurrence_cycles() runs every 15 minutes from pg_cron, ensure_quest_recurrence_cycles() runs it for the caller before the dashboard, /quests and /tasks read, and the migration ran it once for the cycles that had already lapsed. The close moves neither updated_at nor last_activity_at, sends no notification, awards nothing and keeps the template's stall, and a missed cycle the owner reopens is never closed again. get_dashboard_stats() counts a recurring cycle only once it has started, and get_quest_with_tasks() returns lapsed_at. Only the database writes lapsed_at; the sweep and its helper are not client RPCs (#1039).

Tooling & Configuration

  • The pure domain logic both apps need moved into @questify/core, the last slice of #1007: tasks/due-status, tasks/task-deep-link, tasks/list-filters, tasks/types, quests/density, quests/index-params, quests/state, quests/stall-idle, notifications/timezones, location/haversine, location/coordinates, location/types, ai/plan-tiers and ai/investigations moved whole with their tests. Three modules were split, the shared part moving and what reads the database or the browser staying in the web app: ai/credits (the action lists, aiCreditActionCost() and the low-balance rule moved; the charge, refund and free-tier RPC calls stayed), ai/personas (the ModelPersona type and mapModelPersona() moved; the catalogue queries stayed) and analytics (the ANALYTICS_EVENTS catalogue moved as analytics/events; the browser sinks stayed). The task list's remembered "N completed" group now takes any key-value store (ReadableStorage / WritableStorage), and the localStorage lookup it is given stayed in the web app as lib/tasks/browser-storage.ts. The web app's 136 imports of these modules use the package, each named import routed to whichever side now holds it; nothing changed in behaviour. packages/core/README.md lists every module, docs/analytics.md, docs/pricing.md and docs/ai-investigations.md name the new paths, and the mobile app now exercises the shared distance and plan-tier rules (#1007).

  • A new workspace package, @questify/core (packages/core), holds the product rules the web and mobile apps share, the second slice of #1007. This slice moved, unchanged and with their tests, the validators the issue names — auth/validators, notifications/validators, quests/validators, quest-recurrences/validators and year-themes/validators — and the two pure modules they need, quests/schedule and tasks/deadlines. Each module is its own entry point (@questify/core/quests/validators); the web app's 64 imports of them, vi.mock paths included, now use the package, next.config.mjs transpiles it and the web Dockerfile installs it. The only code change, which changes no behaviour: parseNotificationPreferencesForm() takes { get(name): unknown } instead of the DOM FormData type, which a FormData still satisfies. The package's ESLint config fails on browser and Node globals and on imports of Next.js, react-dom, server-only, @supabase/ssr, node:*, an app, or React outside src/react/; tsconfig.json has no DOM lib. Its README lists what has moved and what is still to come. AGENTS.md, README.md and CODEOWNERS name it (#1007).

  • The generated Supabase types moved out of apps/web into a new workspace package, @questify/supabase-types (packages/supabase-types), the first slice of #1007: src/supabase.ts is the generator output (formerly apps/web/src/types/supabase.ts) and src/index.ts the hand-written aliases that re-export it (formerly apps/web/src/types/database.ts). pnpm supabase:typegen and supabase:typegen:local write there; the web app's 146 imports of @/types/supabase and @/types/database now import @questify/supabase-types, with no copy left behind; next.config.mjs transpiles the package and the web Dockerfile installs it. The mobile app's Supabase client is now typed against the same Database. Nothing changed for the worker, which keeps its own hand-written row types. AGENTS.md, the add-migration and precommit-gate skills, README.md, docs/schema.md, docs/ops/deployments.md, docs/feedback-github-issues.md and CODEOWNERS name the new path (#1007).

  • apps/mobile is a new workspace: the Expo / React Native app for iOS and Android, on Expo SDK 58 (React Native 0.88.1, React 19.3) with Expo Router, laid out like Phantom's. app.json holds its identity — name Questify, slug and URL scheme questify, bundle identifier and Android package co.questify.app, portrait — with expo-router as the only plugin, so each feature issue adds its own permission copy; app.config.ts takes the version from the root package.json, so the app moves with every release. It opens to a placeholder screen showing the version and the Supabase host it read, or naming the variables it is missing. src/env.ts validates EXPO_PUBLIC_SUPABASE_URL, EXPO_PUBLIC_SUPABASE_ANON_KEY, EXPO_PUBLIC_SITE_URL and EXPO_PUBLIC_SENTRY_DSN with Zod (documented in a new mobile section of .env.example); EXPO_PUBLIC_FEATURE_* mirrors NEXT_PUBLIC_FEATURE_* and no flag is honoured yet. src/supabase/client.ts builds the supabase-js client with the anon key, PKCE and an in-memory session store until #1010. @sentry/react-native starts only when the DSN is set, with the web app's privacy rules plus no screenshots or view hierarchy, through a third byte-identical copy of the scrubber. The app uses @supabase/supabase-js ^2.118.0: 2.106, which web and the worker still resolve, ships an import(variable) that Hermes cannot compile, so a release build of the app would fail. pnpm dev:mobile starts Expo; pnpm dev now leaves the app out (turbo run dev --filter=!mobile), and pnpm --filter mobile export bundles both platforms without a simulator. Lint, typecheck and test run in CI through the existing turbo steps, so ci.yml is unchanged (#1006).

  • @questify/eslint-config/react-native is the mobile ESLint preset: the React rules of react.js without browser globals, refusing window, document, localStorage, sessionStorage and navigator, and imports of Next.js, react-dom, @supabase/ssr, server-only and apps/web (#1006).

  • The root package.json declares @types/react and @types/react-dom 18. The web app and packages/ui resolve React's types partly through pnpm's hoisting (Next.js and lucide-react do not declare them), and once the mobile app brought React 19's the hoisted copy was no longer guaranteed to be 18; the pin keeps the web typecheck as it was (#1006).

  • pnpm dev:tui -- flags now writes each NEXT_PUBLIC_FEATURE_* flag with its EXPO_PUBLIC_FEATURE_* mirror on the next line, and the new mobile-env action (menu: "Mobile app env") writes apps/mobile/.env.local from the running stack: the Supabase URL rewritten to this machine's LAN address (or QUESTIFY_MOBILE_HOST), the anon key, the web URL and every flag's mirror, refusing any key that is not a public EXPO_PUBLIC_* value and keeping lines added by hand. Re-saving a .env whose keys were all present no longer adds a blank line to the end of the file each time (#1006).

Tests

  • supabase/tests/lapsed_recurring_cycles.sql covers the lapse point across both Toronto DST changes, the sweep for one owner and for everyone, what it must never close, its silence (no notification, achievement, activity stamp or stall resolution), the reopen path, the mint entry point and the dashboard counts, and rls.sql pins who may read lapsed_at (owner, other users and visitors on a public cycle, nobody on a private one) and that no client, the owner included, can insert or change it. Vitest covers questStatusDisplay(), the Missed and Upcoming badges, the /quests badges inside ?template=, /tasks closing lapsed cycles before it reads, and pickInitialQuestId() passing over a past cycle (#1039).

  • The moved modules' suites now run in packages/core (24 files, 355 tests, up from 119), including the credit-cost mirror's checks against the migrations and mapModelPersona(); the web app keeps the tests for what stayed (the charge and free-tier calls, the persona queries, the analytics sinks). New: analytics/events.test.ts (every event named once, in snake_case) and apps/web/src/lib/tasks/browser-storage.test.ts (#1007).

  • The moved validators' Vitest suites (119 tests) now run in packages/core, part of the root pnpm test. apps/mobile/src/core.test.ts runs the shared quest schema, timezone check and schedule conversion from the mobile app's own toolchain (#1007).

  • The generated-types guard moved with the files to packages/supabase-types/src/index.test.ts, which the root pnpm test now runs as its own workspace, and gained a case that fails if either typegen script stops writing packages/supabase-types/src/supabase.ts. apps/mobile/src/supabase/client.types.test.ts asserts at type level that the app's client is SupabaseClient<Database> (#1007).

  • apps/mobile has Vitest suites for its env parsing, home-screen status, in-memory session store and Sentry options. env.test.ts also fails if the app reads any process.env variable that is not EXPO_PUBLIC_*, if a secret-shaped EXPO_PUBLIC_* name appears in the schema, the source or .env.example, if the schema reads an undocumented variable, or if the app mirrors a flag the web app does not document. scripts/dev-tui/mobile-env.test.mjs covers the host choice, the flag mirrors, public-only writes, a symlinked or secret-holding .env.local, and the action end to end through main(); env-flags.test.mjs pins the mirror placement and env-file.test.mjs the blank-line fix. scripts/monitoring-scrub-twins.test.mjs now requires all three scrubber copies to match (#1006).

Documentation

  • AGENTS.md describes apps/mobile, its commands and the rules for working in it (never a secret in Expo public configuration, literal EXPO_PUBLIC_* reads, flag mirrors, thin screens over tested src/ modules, permission copy added by the feature that needs it), and why the root pins React 18's types. README.md, docs/local-docker.md (a new "Running the mobile app" section), docs/ops/error-monitoring.md, docs/agent-skills.md and the precommit-gate, open-pr and add-env-flag skills cover the mobile workspace; precommit-gate gains the expo export check for dependency and app-config changes (#1006).

  • docs/mobile/architecture.md records the architecture of the native app: Expo / React Native in this monorepo, with the alternatives considered; reads and ordinary writes straight to Supabase under RLS, including the column-level grants that rule out select('*') on tasks, quests, weekly_reviews and year_theme_alignment_checks; route handlers that accept a Supabase Bearer token for operations that need a server secret; and worker completions delivered through Realtime. It inventories all 99 Server Actions in 27 modules and every /api route handler, with each effect beyond the write assigned to the database, a worker outbox, a Bearer handler, the client or nothing, and turns that into the backlog for #1007–#1009. It notes that the supabase_realtime publication has no tables today and names the five that must join it (task_investigations, notifications, quest_narrations, task_evidence, quest_stall_notifications), each with RLS confirmed; it also lists what the app will not do, starting with admin and buying Pro. AGENTS.md gains a Mobile Client section with the two rules every PR now follows: a write's effects live in the database or the worker, never only in a Server Action, and a route handler the app calls accepts a Bearer token (#1005).