Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added support for updating the site actor #207

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

allouis
Copy link
Collaborator

@allouis allouis commented Nov 25, 2024

ref https://linear.app/ghost/issue/AP-592

When we fetch the site data we'll attempt to update the site actor too, this
will ensure that when Ghost boots any changes are propagated to us.

We're handling the sending of the Update activity ourself, and there's room to
remove duplication here. I'd like to think about what pattern we use for this.
Ideally I think a repository would be responsible for this or at least abstract
it.

src/handlers.ts Outdated Show resolved Hide resolved
src/handlers.ts Outdated Show resolved Hide resolved
src/handlers.ts Outdated
});
}

async function updateSiteActor(db: KvStore, logger: Logger, host: string) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could move this to the actor helpers and add a test?

ref https://linear.app/ghost/issue/AP-592

We need to start moving logic out of HTTP handlers. This logic needs to be
reused so that we can update the site actor when initialising the site.
ref https://linear.app/ghost/issue/AP-592

We don't want to define our HTTP handlers inline in app.ts, instead pulling
them into separate files, this will keep app.ts smaller and let use share code
between the handlers easier.
ref https://linear.app/ghost/issue/AP-592

When we fetch the site data we'll attempt to update the site actor too, this
will ensure that when Ghost boots any changes are propagated to us.

We're handling the sending of the Update activity ourself, and there's room to
remove duplication here. I'd like to think about what pattern we use for this.
Ideally I think a repository would be responsible for this or at least abstract
it.
ref https://linear.app/ghost/issue/AP-592

This just pulls out some shared logic into the update actor function, I'm not
100% on colocated storage and AP network code but I think it's fine for now
while we work the structure out.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants