Skip to content

Commit

Permalink
Timeline inboxes
Browse files Browse the repository at this point in the history
  • Loading branch information
dahlia committed Dec 26, 2024
1 parent 0b6750e commit 08b9fde
Show file tree
Hide file tree
Showing 16 changed files with 3,850 additions and 328 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
with:
version: 9
version: 9.15.1
run_install: false
- uses: actions/setup-node@v4
with:
Expand Down
7 changes: 7 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,13 @@ To be released.
- Hollo is now powered by Node.js 23+ instead of Bun for more efficient
memory usage.

- Added an experimental feature flag `TIMELINE_INBOXES` to store all posts
visible to your timeline in the database, rather than filtering them
in real-time as they are displayed. This is useful for relatively
larger instances with many incoming posts, but as of now it may have
several bugs. It is expected to be the default behavior in the future
after it is stabilized.

- Now you can import and export your data from the administration dashboard
in CSV format: follows, lists, accounts you muted, accounts you blocked,
and bookmarks.
Expand Down
12 changes: 12 additions & 0 deletions docs/src/content/docs/install/env.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,18 @@ encountered first time.

`10` by default.

### `TIMELINE_INBOXES` <Badge text="Optional" />

Setting this to `true` lets your timelines work like inboxes: all posts visible
to your timeline are physically stored in the database, rather than being
filtered in real-time as they are displayed. This is useful for relatively
larger instances with many incoming posts.

As of Hollo 0.4.0, it is experimental and may have several bugs, but it is
epxected to be the default behavior in the future after it is stabilized.

Turned off by default.


Logging and debugging
---------------------
Expand Down
12 changes: 12 additions & 0 deletions docs/src/content/docs/ja/install/env.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,18 @@ HolloがL7ロードバランサーの後ろにある場合(通常はそうす

デフォルトは`10`です。

### `TIMELINE_INBOXES` <Badge text="オプション" />

このオプションを`true`に設定すると、タイムラインが受信箱のように動作します。
つまり、タイムラインに表示される投稿がリアルタイムでフィルタリングされるのではなく、
事前に取得された投稿がデータベースに保存されます。
この機能は多くのリモート投稿を受信する相対的に大きなインスタンスで有用です。

Hollo 0.4.0時点では、この機能は実験的であり、バグがあるかもしれません。
しかし、この機能は安定化した後にデフォルトの動作に変更される予定です。

基本的にはオフになっています。


ログとデバッグ
--------------
Expand Down
12 changes: 12 additions & 0 deletions docs/src/content/docs/ko/install/env.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,18 @@ Hollo가 L7 로드 밸런서 뒤에 위치할 경우 (일반적으로 그래야

기본값은 `10`입니다.

### `TIMELINE_INBOXES` <Badge text="선택" />

이 옵션을 `true`로 설정하면 타임라인이 수신함처럼 작동합니다. 즉, 타임라인에
표시될 게시물들이 실시간으로 필터링되는 것이 아니라, 미리 추출된 게시물들이
데이터베이스에 저장됩니다. 이 기능은 많은 원격 게시물을 수신하는 상대적으로
큰 인스턴스에서 유용합니다.

Hollo 0.4.0 시점에서 이 기능은 실험적이며, 버그가 있을 수 있습니다. 하지만
이 기능은 안정화된 뒤에 기본 동작으로 바뀔 예정입니다.

기본적으로는 꺼져 있습니다.


로그 및 디버그
--------------
Expand Down
11 changes: 11 additions & 0 deletions docs/src/content/docs/zh-cn/install/env.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,17 @@ openssl rand -hex 32

默认为`10`

### `TIMELINE_INBOXES` <Badge text="可选" />

将此设置为`true`后,您的时间线就像收件箱一样:
时间线上可见的所有帖子都实际存储在数据库中,而不是在显示时实时过滤。
这对于有大量传入帖子的相对较大的实例非常有用。

从Hollo 0.4.0开始,它还处于实验阶段,可能存在一些错误,
但预计在稳定后将成为未来的默认行为。

默认情况下关闭。


日志和调试
----------
Expand Down
18 changes: 18 additions & 0 deletions drizzle/0059_timeline_inboxes.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
CREATE TABLE "list_posts" (
"list_id" uuid NOT NULL,
"post_id" uuid NOT NULL,
CONSTRAINT "list_posts_list_id_post_id_pk" PRIMARY KEY("list_id","post_id")
);
--> statement-breakpoint
CREATE TABLE "timeline_posts" (
"account_id" uuid NOT NULL,
"post_id" uuid NOT NULL,
CONSTRAINT "timeline_posts_account_id_post_id_pk" PRIMARY KEY("account_id","post_id")
);
--> statement-breakpoint
ALTER TABLE "list_posts" ADD CONSTRAINT "list_posts_list_id_lists_id_fk" FOREIGN KEY ("list_id") REFERENCES "public"."lists"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
ALTER TABLE "list_posts" ADD CONSTRAINT "list_posts_post_id_posts_id_fk" FOREIGN KEY ("post_id") REFERENCES "public"."posts"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
ALTER TABLE "timeline_posts" ADD CONSTRAINT "timeline_posts_account_id_account_owners_id_fk" FOREIGN KEY ("account_id") REFERENCES "public"."account_owners"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
ALTER TABLE "timeline_posts" ADD CONSTRAINT "timeline_posts_post_id_posts_id_fk" FOREIGN KEY ("post_id") REFERENCES "public"."posts"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
CREATE INDEX "list_posts_list_id_post_id_index" ON "list_posts" USING btree ("list_id","post_id");--> statement-breakpoint
CREATE INDEX "timeline_posts_account_id_post_id_index" ON "timeline_posts" USING btree ("account_id","post_id");
Loading

0 comments on commit 08b9fde

Please sign in to comment.