Changeset 2d6a9c3 in Klonkt for src/config/database.js


Ignore:
Timestamp:
07/16/2026 12:20:51 PM (8 weeks ago)
Author:
Robin <roboburr@…>
Branches:
main
Children:
af21002
Parents:
8878814
git-author:
Robin <roboburr@…> (07/13/2026 05:21:50 AM)
git-committer:
Robin <roboburr@…> (07/16/2026 12:20:51 PM)
Message:

Spoor A step 1: bake post display HTML at save (ActivityPub source model)

Introduce the source/rendered split: posts.content stays the raw source (what
the editor round-trips), a new content_rendered column holds the baked display
HTML. bakePostContent() runs the linkify pipeline once at create/edit and
caches it; the render route serves content_rendered (falling back to an
on-the-fly bake for not-yet-baked posts) and no longer re-linkifies every view.
Verified: baked and fallback paths render byte-identically and a baked lone URL
still becomes an embed. This is the seam for step 2 (resolve @mentions once at
save instead of per page view) and removes the per-render linkify cost.

Co-Authored-By: Claude Opus 4.8 <noreply@…>

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/config/database.js

    r8878814 r2d6a9c3  
    387387  ensureColumn('ap_followers', 'last_delivery_at', 'DATETIME'); // last SUCCESSFUL delivery to this follower's inbox
    388388  ensureColumn('ap_followers', 'last_error_at', 'DATETIME');    // last time a delivery to it gave up (max retries)
     389
     390  // ActivityPub `source` model: content_rendered = baked display HTML (#hashtags / URLs /
     391  // @mentions linkified once at save). `content` stays the raw source used for editing and
     392  // re-rendering. NULL on old posts → the render route bakes on the fly as a fallback.
     393  ensureColumn('posts', 'content_rendered', 'TEXT');
    389394}
    390395
Note: See TracChangeset for help on using the changeset viewer.