Ignore:
Timestamp:
09/04/2026 12:17:49 PM (4 days ago)
Author:
Robin <roboburr@…>
Branches:
main
Children:
6d7ea52
Parents:
9946a68
Message:

Tijdstempels: de posts-kant ook, en de tijdbom ontmanteld (shaer-a937)

Correctie op mijn eigen sluitreden bij 9946a68: ik schreef daar dat de
posts-sorteringen door isoSql lopen, en dat was niet zo -- ik had ze juist
overgeslagen omdat ze vandaag nog niet scheef staan.

Twee dingen alsnog:

De TIJDBOM uit de bead. Scheduler zette published_at op CURRENT_TIMESTAMP,
dus zodra iemand een post inplant en die vanzelf publiceert, staat er SQL-
notatie tussen de ISO's en sorteert het hele archief door elkaar. Die schrijft
nu ISO, net als de andere zes schrijfwegen.

En het VANGNET voor wat er al staat: de zeven posts-sorteringen (outbox,
backfill, featured tweemaal, muziek tweemaal, beheeroverzicht) lopen nu ook
door isoSql. Half normaliseren is de verwarrendste toestand -- dan hangt het
per scherm af of een gemengde kolom goed valt.

Onderweg gecontroleerd dat elke gebruiker van isoSql en NU_ISO ze ook
importeert: admin.js gebruikte hem zonder import, en dat was pas omgevallen
op het moment dat iemand het beheeroverzicht opende. Alle aangeraakte
bestanden door node --check.

Volle suite 1255 groen.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/services/ActivityPubService.js

    r9946a68 r1d1fdc9  
    1919import fs from 'fs';
    2020import path from 'path';
    21 import db, { NU_ISO } from '../config/database.js';
     21import db, { NU_ISO, isoSql } from '../config/database.js';
    2222import HtmlSanitizerService from './HtmlSanitizerService.js';
    2323import AudioEmbedService from './AudioEmbedService.js';
     
    11431143  const fanClause = fanOnly ? '' : 'AND (p.fan_only IS NULL OR p.fan_only = 0)';
    11441144  const unie = `
    1145     SELECT 'post' AS soort, p.id AS id, COALESCE(p.published_at, p.created_at) AS wanneer
     1145    SELECT 'post' AS soort, p.id AS id, ${isoSql('COALESCE(p.published_at, p.created_at)')} AS wanneer
    11461146      FROM posts p WHERE p.site_id = ? AND p.status = 'published' ${fanClause}
    11471147    UNION ALL
     
    19271927     FROM posts WHERE site_id = ? AND status = 'published' AND (fan_only IS NULL OR fan_only = 0)
    19281928       AND IFNULL(ap_visibility, 'public') = 'public'
    1929      ORDER BY COALESCE(published_at, created_at) DESC LIMIT 20`
     1929     ORDER BY ${isoSql('COALESCE(published_at, created_at)')} DESC LIMIT 20`
    19301930  ).all(site.id).reverse();
    19311931  if (!recent.length) return;
     
    20852085    `SELECT id FROM posts WHERE site_id = ? AND status = 'published' AND (fan_only IS NULL OR fan_only = 0)
    20862086       AND pinned IS NOT NULL AND pinned > 0
    2087      ORDER BY pinned DESC, COALESCE(published_at, created_at) ASC LIMIT 20`
     2087     ORDER BY pinned DESC, ${isoSql('COALESCE(published_at, created_at)')} ASC LIMIT 20`
    20882088  ).all(site.id);
    20892089  const removeIds = [...new Set([...pinned.map((p) => p.id), ...alsoRemove])];
Note: See TracChangeset for help on using the changeset viewer.