Skip to content
This repository was archived by the owner on Jan 16, 2026. It is now read-only.

Commit 2e7db31

Browse files
authored
Merge pull request imas#453 from imas/fix/do-not-deliver-private-status-to-hashtag-stream
visibilityがprivateであるstatusが誤ってタグTLのストリームに配信されていたバグを修正
2 parents 702ca17 + 455d960 commit 2e7db31

File tree

3 files changed

+63
-2
lines changed

3 files changed

+63
-2
lines changed

.circleci/config.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,9 @@ jobs:
6868
cache-version: v1
6969
pkg-manager: yarn
7070
- run:
71-
command: ./bin/rails assets:precompile
71+
command: |
72+
export NODE_OPTIONS=--openssl-legacy-provider
73+
./bin/rails assets:precompile
7274
name: Precompile assets
7375
- persist_to_workspace:
7476
paths:

app/services/fan_out_on_write_service.rb

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,13 @@ def fan_out_to_local_recipients!
4141
notify_about_update! if update?
4242

4343
case @status.visibility.to_sym
44-
when :public, :private, :unlisted
44+
when :public, :unlisted
4545
deliver_to_all_followers!
4646
deliver_to_lists!
4747
deliver_to_hashtag_streams_authorized_channel!
48+
when :private
49+
deliver_to_all_followers!
50+
deliver_to_lists!
4851
when :limited
4952
deliver_to_mentioned_followers!
5053
else

spec/imastodon/services/fan_out_on_write_service_spec.rb

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,20 @@
8888
it_behaves_like 'tagTLのauthorizedチャンネルに配信される'
8989
end
9090

91+
context 'private' do
92+
let(:visibility) { :private }
93+
it_behaves_like 'LTLに配信されない'
94+
it_behaves_like 'tagTLのunauthorizedチャンネルに配信されない'
95+
it_behaves_like 'tagTLのauthorizedチャンネルに配信されない'
96+
end
97+
98+
context 'direct' do
99+
let(:visibility) { :direct }
100+
it_behaves_like 'LTLに配信されない'
101+
it_behaves_like 'tagTLのunauthorizedチャンネルに配信されない'
102+
it_behaves_like 'tagTLのauthorizedチャンネルに配信されない'
103+
end
104+
91105
context 'メンションが含まれる投稿' do
92106
let(:body) { '@tachibana ヘイヘーイ。 そこのカノジョー、一緒にブラデリカしないかーい? #hoge #fuga #nyowa' }
93107

@@ -104,6 +118,20 @@
104118
it_behaves_like 'tagTLのunauthorizedチャンネルに配信されない'
105119
it_behaves_like 'tagTLのauthorizedチャンネルに配信される'
106120
end
121+
122+
context 'private' do
123+
let(:visibility) { :private }
124+
it_behaves_like 'LTLに配信されない'
125+
it_behaves_like 'tagTLのunauthorizedチャンネルに配信されない'
126+
it_behaves_like 'tagTLのauthorizedチャンネルに配信されない'
127+
end
128+
129+
context 'direct' do
130+
let(:visibility) { :direct }
131+
it_behaves_like 'LTLに配信されない'
132+
it_behaves_like 'tagTLのunauthorizedチャンネルに配信されない'
133+
it_behaves_like 'tagTLのauthorizedチャンネルに配信されない'
134+
end
107135
end
108136

109137
context '自分以外の投稿へのin_reply_toが設定されている投稿' do
@@ -122,6 +150,20 @@
122150
it_behaves_like 'tagTLのunauthorizedチャンネルに配信されない'
123151
it_behaves_like 'tagTLのauthorizedチャンネルに配信されない'
124152
end
153+
154+
context 'private' do
155+
let(:visibility) { :private }
156+
it_behaves_like 'LTLに配信されない'
157+
it_behaves_like 'tagTLのunauthorizedチャンネルに配信されない'
158+
it_behaves_like 'tagTLのauthorizedチャンネルに配信されない'
159+
end
160+
161+
context 'direct' do
162+
let(:visibility) { :direct }
163+
it_behaves_like 'LTLに配信されない'
164+
it_behaves_like 'tagTLのunauthorizedチャンネルに配信されない'
165+
it_behaves_like 'tagTLのauthorizedチャンネルに配信されない'
166+
end
125167
end
126168

127169
context '自分の投稿へのin_reply_toが設定されている投稿' do
@@ -140,6 +182,20 @@
140182
it_behaves_like 'tagTLのunauthorizedチャンネルに配信されない'
141183
it_behaves_like 'tagTLのauthorizedチャンネルに配信される'
142184
end
185+
186+
context 'private' do
187+
let(:visibility) { :private }
188+
it_behaves_like 'LTLに配信されない'
189+
it_behaves_like 'tagTLのunauthorizedチャンネルに配信されない'
190+
it_behaves_like 'tagTLのauthorizedチャンネルに配信されない'
191+
end
192+
193+
context 'direct' do
194+
let(:visibility) { :direct }
195+
it_behaves_like 'LTLに配信されない'
196+
it_behaves_like 'tagTLのunauthorizedチャンネルに配信されない'
197+
it_behaves_like 'tagTLのauthorizedチャンネルに配信されない'
198+
end
143199
end
144200
end
145201
end

0 commit comments

Comments
 (0)