Skip to content

Commit 6c209d3

Browse files
committed
Sync tutorial with the Fedify 2.2.0-dev.949 init template
Two follow-ups for the upstream init template change in fedify-dev#726: - Chapter 2 now lists *server/plugins/logging.ts* alongside *server/logging.ts*, with a one-line explanation of how the Nitro plugin awaits the configuration promise. - Chapter 10's *Follow* listener now sets an explicit `id` on the outbound `Accept`, matching the example repository. A new bullet in the walkthrough calls out why the explicit id matters for Pixelfed compatibility, even though Fedify can auto-generate one. Assisted-by: Claude Code:claude-opus-4-7
1 parent e625800 commit 6c209d3

1 file changed

Lines changed: 20 additions & 2 deletions

File tree

docs/tutorial/content-sharing.md

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,12 @@ The most interesting files and directories are:
212212
- *federation.ts*: the Fedify federation object. This is where actors,
213213
inbox listeners, and object dispatchers are registered. Most of our
214214
work will land here.
215-
- *logging.ts*: [LogTape] configuration used by Fedify.
215+
- *logging.ts*: [LogTape] configuration used by Fedify. The default
216+
export is the configuration promise; we never call into this file
217+
directly.
218+
- *plugins/logging.ts*: a [Nitro server plugin] that awaits the
219+
configuration promise on startup so Fedify's logs are alive before
220+
any request lands.
216221
- *nuxt.config.ts*: Nuxt's configuration file; already has `@fedify/nuxt`
217222
wired up as a module.
218223
- *package.json*: npm metadata and dependencies.
@@ -225,6 +230,7 @@ TypeScript) or *.vue* (for Vue single-file components that may contain
225230
TypeScript in their `<script>` blocks).
226231

227232
[LogTape]: https://logtape.org/
233+
[Nitro server plugin]: https://nitro.build/guide/plugins
228234
[Biome]: https://biomejs.dev/
229235

230236
### Running the dev server for the first time
@@ -2235,6 +2241,10 @@ federation
22352241
target,
22362242
follower,
22372243
new Accept({
2244+
id: new URL(
2245+
`#accepts/${crypto.randomUUID()}`,
2246+
ctx.getActorUri(target.identifier),
2247+
),
22382248
actor: follow.objectId,
22392249
to: follow.actorId,
22402250
object: follow,
@@ -2268,7 +2278,15 @@ Walking through the listener:
22682278
sender (the parsed actor target), the recipient (the remote
22692279
follower), and the activity to send. We construct an `Accept`
22702280
whose `object` is the original `Follow`; that is how Mastodon
2271-
correlates our reply with their pending follow.
2281+
and Pixelfed correlate our reply with their pending follow.
2282+
2283+
- *The explicit `id` on the `Accept`.* Fedify will auto-generate
2284+
an id if you do not provide one, but the auto-generated form
2285+
(`https://<host>/#Accept/<uuid>`) confuses Pixelfed: the local
2286+
follow stays in a half-finished state and the *Follow* button
2287+
never flips. Building the id under the actor's URI
2288+
(`<actor>#accepts/<uuid>`) follows the convention Mastodon uses
2289+
and works on every implementation we tested.
22722290
22732291
> [!TIP]
22742292
> [`getActorHandle()`] returns the canonical fediverse handle in

0 commit comments

Comments
 (0)