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

Unknown adapter behavior #2

Open
MCTaylor17 opened this issue Nov 30, 2019 · 5 comments
Open

Unknown adapter behavior #2

MCTaylor17 opened this issue Nov 30, 2019 · 5 comments

Comments

@MCTaylor17
Copy link
Collaborator

Summary

R&D required to fully implement the storage adapter.

Problem

The official docs are pretty lacking. Of the five required methods, the descriptions don't offer any insights into when they're called.
This is complicated by the fact that none of the parameters are listed for any of the methods.

Of the 5 methods, I've only been able to successfully invoke the save method by adding images to a post.

Searching the Ghost codebase for the other method names has come up short. My best guess is the adapter is passed to plugins.

Impact

Removing images fails to trigger delete meaning they remain pinned indefinitely.

Solution

Unknown.

@MCTaylor17
Copy link
Collaborator Author

Current returning fully formed url from the save method. This might be bypassing the serve middleware as well as other methods.

@bmann
Copy link
Member

bmann commented Nov 30, 2019

Thanks @MCTaylor17 — did you look at the S3 Adapter to see how it’s done there?

@MCTaylor17
Copy link
Collaborator Author

I think I looked at every storage adapter 😂

It's pretty clear each of them emulates the others and I can't help thinking there's a little mythology at play.

I have some basic tests that I need to try. For example, I didn't try adding new posts or pages and I'm optimistic that returning just the CID will send it through the middleware.

Whatever my findings, I plan to post an issue with Ghost to clarify the documentation.

@bmann
Copy link
Member

bmann commented Nov 30, 2019

Yes only images and files use this. Pages / posts are stored in the database.

Adding an image to a post / page should trigger.

Also a post image (in the slide out drawer) and I think a few other places like background header.

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

No branches or pull requests

2 participants