BuildInPublic

#buildinpublic #mbsync Continuing from yesterday. I will rewrite the markForSync method so it iterates over the posts in the db instead of the files to be able to detect deleted files as well. Just have to check if there are any tests to work with, or if I have to add them first.

#buildinpublic #mbsync Well. Looks like I will not continue today…

#buildinpublic #mbsync Will continue but we have stuff to do in the city.

#buildinpublic #mbsync It seems that I have a column in the posts table called sync_status that is enum('pending','synced','deleted') so it seems to me I need to set this to deleted if the file is missing, which implies that instead of iterating over the blog post files and marking the posts in the db I need to iterate over the blogposts in the db since otherwise I miss the deleted files. Does this make sense?

  • Files:
    • 1
    • 2
    • 3
  • Posts in DB
    • 1
    • 2
    • 3

I was checking the files against the db to find new and updated posts, but I’m now going to check the db against the files instead. I should still be able to find new/updated posts, but also posts that are missing from the filesystem.

#buildinpublic #mbsync Alright found something todo: // TODO: mark post as deleted

The way this app works is by downloading posts and keeping a hash in the database and also saving them to the filesystem. There is a rudimentary implementation for new and updated posts, but files that are deleted from the filesystem are not marked as deleted in the db. The db is what gets synced with mb though. So we need a field on the post that marks it as deleted, so that when we sync the next time the post can be deleted from mb.

One thing that always happens with this one: Don’t know what the next step is. Learning goals are for now:

  • phpstorm
  • laravel
  • tdd

So I use herd and dbngin for the local dev env and use phpstorm as the ide and realize that I have uncomitted stuff. Let’s see if the tests pass.

#buildinpublic #mbsync

Inspired by @vincent I am going to #buildinpublic. I have a nice little learning project that is supposed to be like blot but for micro.blog. I’m calling it mb-sync and I’m going to use #mbsync to refer to it.