KitaitiMakoto
KitaitiMakoto created pull request plume/documentation#119 2021-01-05 15:03:40 +00:00
Fix update step for Docker
KitaitiMakoto pushed to fix-update at plume/documentation 2021-01-05 15:03:14 +00:00
b0f01d4b38 Fix update step for Docker
KitaitiMakoto commented on pull request Plume/Plume#868 2021-01-05 14:08:33 +00:00
Fix #623 tracing crate

ok, I need walk carefully.

KitaitiMakoto commented on pull request Plume/Plume#868 2021-01-05 13:42:38 +00:00
Fix #623 tracing crate

tracing crate seems great! But I think we can merge this pull request. Replacing log crate with tracing after that pull request will be merged is easy: just replacing use log:: with use tracing::.

Additionally, we are reported some ActivityPub related issues. I want to introduce logging and use it soon to investigate what's wrong. That pull request will be merged into MASTER branch, which meen we need upgrade Rocket to 0.5.0 or later to use tracing (unless we introduce it ourselves). You know, that's a hard work.

How do you think?

KitaitiMakoto created pull request Plume/Plume#868 2021-01-05 12:45:23 +00:00
log crate
KitaitiMakoto pushed to logging at Plume/Plume 2021-01-05 12:42:17 +00:00
fb2326b751 Use eprintln! instead of println! for console message
35dccda7cc Replace println!()s with logging macros
1c92dba678 Fix a typo
837406de78 Initialize Rocket early to initialize logger early
577f39b608 Extract dotenv initialization from init_pool because it affects not only database
KitaitiMakoto closed issue Plume/Plume#534 2021-01-04 14:12:23 +00:00
Preprocessor directives considered hashtags
KitaitiMakoto commented on pull request Plume/Plume#813 2021-01-04 11:27:21 +00:00
WIP: Extract DbConn, Searcher & Worker into Riker Actors

I respect your great research and implementation, and completely agree with introducing Riker. In addition, I make a suggestion: use Riker's Channels as a global variable. There are two points:

  • The primary is to make it global, and
  • The secondary is use of pub/sub model using channels

What is solved?

At current attempting (its strategy and current implementation: 8aa4ae4302), we need touch searcher more than ever before. Also, we need flow, some agents (like searcher actor or post ids) through multiple structs.

See updating search document procedure. When a user updates a post, a request handler does two (or more) things: it

  • updates posts and related records in database
  • sends a UpdateDocument message to SearcherActor

Developers need always do them together. This is needed for not only request handlers but AsObject and FromId implementations for models. As such, developers need write more code than now. And they might have forgotten sending message to the actor.

To make matters worse, this introduces more complexity. Assume you're deleting a user. routes::user::delete() request handler is called. It needs to know all blogs and posts that the deleting user owns in order to send DeleteDocument messeges corresponding to deleted posts to searcher actor. How?

One way is: Post::delete() returns itself to Blog, Blog::delete() returns deleted Posts to User, User::delete() returns deleted Blogs' posts to the handler, and fanally the handler sends messeges to the actor. If some posts could not be deleted, the handler need make sure to send DeleteDocument for each only deleted post. That's complex.

The another is: the handler passes the searcher actor to User::delete() as an argument, User::delete() passes it to Blog::delete(), Blog::delete() calls Post::delete() and send a DeleteDocument message to the actor several times. This is essentially same to above.

Introducing a global variable solves this. Using it, Post::insert(), update() and delete() need to neither accept a searcher as an agument nor return back itself (or its ID) to the caller. What it needs to do is getting global searcher (or so) and sending a messege that it is deleted. That's it.

There are options what struct should be global like a searcher actor, an actor system or a channel. I suggest Riker's channel because...

More benefit

Use of channel introduces pub/sub model. In the case above, Post publishes "delete" event to a channel and SearcherActor subscribes to the event and deletes the search index corresponding to the post. More than that, we can add other actors which concern post's deletion without touching any code of request handlers and models. Examples are:

  • an actor (say, "outbox") which subscribes to post's publishing, updating, deleting event and sends ActivityPub requests to other instances
  • an actor ("notifier") which subscribes to post's events and updates notification page of followers and mentioned users
  • similar to the above but sends notification mails
  • and so on.

A proof of concept is here: https://git.joinplu.me/KitaitiMakoto/Plume/compare/igalic/refactor/extract-actors...channel. Pay your attention to

// a `SearcherActor` subscribes to any event (`"*"`)

POST_CHAN.get().unwrap().tell(Subscribe { actor: Box::new(searcher_actor), topic: "*".into() }, None);
// `Post` publishes an event without the need knowing who accepts it

        if post.published {
            crate::POST_CHAN.get().unwrap().tell(Publish { msg: PostUpdated(post.clone()), topic: "post.updated".into() }, None);
        }

Rebasing

How do you think? I you aggree with me, I'm thiking it might be better to restart from current 0.6.0+ code (of course, I will do it). Any questions and discussions are welcome!

KitaitiMakoto pushed to igalic/refactor/extract-actors at KitaitiMakoto/Plume 2021-01-04 09:38:55 +00:00
KitaitiMakoto pushed to channel at KitaitiMakoto/Plume 2021-01-04 09:32:05 +00:00
2e9fd05d6d Update posts when requested
74faac61a4 Make plume_models::search::searcher public
1c464c829e Publish PostUpdate to channel instead of tell ActorSearcher directly
27618def0c Make SearcherActor subscribe to channel
100d73c859 Change SearcherActor's message from SearcherActorMsg to PostEvent
KitaitiMakoto commented on issue Plume/Plume#850 2021-01-04 06:07:18 +00:00
XMLHttpRequest for boost and likes

I found the issue for API: #5

KitaitiMakoto closed issue Plume/Plume#652 2021-01-04 01:24:19 +00:00
Content area and menu overflow past their border on mobile in the new theme
KitaitiMakoto closed issue Plume/Plume#655 2021-01-04 01:18:07 +00:00
Margins are too narrow on mobile
KitaitiMakoto opened issue Plume/Plume#867 2021-01-02 21:32:20 +00:00
Add regression test for #865
KitaitiMakoto deleted branch encode-remote-interact from Plume/Plume 2021-01-02 21:28:52 +00:00
KitaitiMakoto merged pull request Plume/Plume#866 2021-01-02 21:28:35 +00:00
Percent encode URI for remote_interact
KitaitiMakoto closed issue Plume/Plume#865 2021-01-02 21:28:35 +00:00
Convert IRI to URI on remote interaction
KitaitiMakoto merged pull request Plume/Plume#866 2021-01-02 21:28:28 +00:00
Percent encode URI for remote_interact
KitaitiMakoto pushed to main at Plume/Plume 2021-01-02 21:28:28 +00:00
d0dd23a1af Merge pull request 'Percent encode URI for remote_interact' (#866) from encode-remote-interact into main
f8774223d4 Update pot file
bca870f1f8 Percent encode URI for remote_interact
Compare 3 commits »
KitaitiMakoto created pull request Plume/Plume#866 2021-01-02 20:52:59 +00:00
Percent encode URI for remote_interact