Réglages : choisir ses notifications ; journal de la console lisible
deploy / deploy (push) Successful in 1m12s

- Réglages → Notifications (comptes connectés) : un interrupteur par type, en 3 groupes (abonnements,
  mes avis, activité des comptes suivis), 18 langues. Choix synchronisé (settings.notifOff).
- Serveur (20261201110000, appliquée) : une notification d'un type désactivé n'est pas créée (trigger
  notifications_wanted) ; celles déjà reçues sont masquées de la liste et du compteur.
- Console : les détails des connexions étaient enregistrés comme texte JSON et affichés lettre par
  lettre. Enregistrement corrigé (sql.json), anciennes lignes remises en forme à la lecture
  (20261201100000), appareil affiché en clair (« Chrome · Windows »).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YVo1qxKoBQCaMd7Ue8PGbe
This commit is contained in:
Claude committed 2026-12-01 10:10:33 +00:00
1 parent 7903064147
commit 43e2ecd589
28 files changed
+432 -10

No files matched your search

@@ -0,0 +1,25 @@
-- Journal de la console : les détails des connexions avaient été enregistrés comme texte JSON (et non objet),
-- affichés lettre par lettre. Le journal ne peut pas être modifié : la lecture les remet en forme. Idempotent.
create or replace function admin.as_object(d jsonb)
returns jsonb language plpgsql immutable set search_path = '' as $$
begin
if jsonb_typeof(d) = 'string' then
d := (d #>> '{}')::jsonb;
end if;
return case when jsonb_typeof(d) = 'object' then d else '{}'::jsonb end;
exception when others then
return '{}'::jsonb;
end;
$$;
comment on function admin.as_object(jsonb) is 'Détails du journal toujours sous forme d''objet (anciennes lignes enregistrées en texte).';
create or replace function admin.journal_list(p_offset integer)
returns jsonb language sql stable set search_path = '' as $$
select coalesce(jsonb_agg(j.row order by j.id desc), '[]'::jsonb) from (
select j.id, jsonb_build_object('id', j.id, 'at', j.at, 'action', j.action, 'target', j.target, 'details', admin.as_object(j.details),
'admin', (select username from public.profiles where id = j.admin_id)) as row
from admin.journal j order by j.id desc
limit 50 offset greatest(coalesce(p_offset, 0), 0)
) j;
$$;
revoke all on function admin.as_object(jsonb) from public, anon, authenticated, service_role;