Changeset 5a6a457 in Klonkt for src/routes


Ignore:
Timestamp:
06/25/2026 05:15:48 AM (3 months ago)
Author:
Robin Genis <roboburr@…>
Branches:
main
Children:
d7526bd
Parents:
99234c3
Message:

feat(fediverse): federate on save+scheduler, delivery retry-queue, music as listen-link

#1 Posts now federate to followers not only on create, but also when a draft/

scheduled post becomes published (editor save) and when the Scheduler flips a
scheduled post live — previously those silently didn't reach followers.

#2 Delivery retry-queue (ap_delivery): a failed delivery (down server/timeout) is

queued and retried with backoff (1/5/15/60/180/360 min, 6 tries) by a worker,
instead of fire-and-forget. Signing key re-derived from the slug, never stored.

#3 Music posts: audio shortcodes federate as a '🎵 listen on the site' link to the

post (protected player) instead of the raw mp3 — keeps Klonkt's audio friction
intact (no downloadable file handed to Mastodon).

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/routes/posts.js

    r99234c3 r5a6a457  
    353353    }
    354354  } catch (e) { /* FTS issues non-fatal */ }
     355
     356  // ActivityPub: federate when a post BECOMES published (draft/scheduled → published
     357  // via the editor). A brand-new published post is handled in the create route.
     358  if (finalStatus === 'published' && post.status !== 'published' && !fanOnly) {
     359    ActivityPubService.deliverCreate(site, {
     360      id: post.id, slug: finalSlug, title: title || finalSlug,
     361      content: cleanContent, cover_image_url: cover_image_url || null,
     362      published_at: publishedAt, created_at: post.created_at,
     363    }).catch(() => { /* best-effort */ });
     364  }
    355365
    356366  res.redirect(`${res.locals.siteUrlBase || ''}/${finalSlug}`);
Note: See TracChangeset for help on using the changeset viewer.