Changeset af21002 in Klonkt for src/routes/posts.js
- Timestamp:
- 07/16/2026 12:20:51 PM (8 weeks ago)
- Branches:
- main
- Children:
- 476d6e7
- Parents:
- 2d6a9c3
- git-author:
- Robin <roboburr@…> (07/13/2026 05:24:58 AM)
- git-committer:
- Robin <roboburr@…> (07/16/2026 12:20:51 PM)
- File:
-
- 1 edited
-
src/routes/posts.js (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
src/routes/posts.js
r2d6a9c3 raf21002 243 243 // baking on the fly if this ever fails. 244 244 function cacheRenderedContent(postId, rawContent) { 245 const raw = rawContent || ''; 246 // 1. Immediate + synchronous: bake #hashtags + URLs so the post renders enriched at once. 245 247 try { 246 248 db.prepare('UPDATE posts SET content_rendered = ? WHERE id = ?') 247 .run(ActivityPubService.bakePostContent(raw Content || ''), postId);249 .run(ActivityPubService.bakePostContent(raw), postId); 248 250 } catch (e) { /* fallback bake in the render route keeps display correct */ } 251 // 2. Async: resolve @mentions (webfinger, once) and re-store, WITHOUT blocking the save 252 // response — a moment later the post's @mentions are clickable too. A slow/dead remote 253 // server can't stall the save; on failure the sync bake from step 1 stands. 254 ActivityPubService.bakePostContentWithMentions(raw) 255 .then((html) => { 256 try { db.prepare('UPDATE posts SET content_rendered = ? WHERE id = ?').run(html, postId); } 257 catch (e) { /* keep the sync bake */ } 258 }) 259 .catch(() => { /* keep the sync bake */ }); 249 260 } 250 261
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)