summaryrefslogtreecommitdiff
path: root/packages/backend/test/e2e/streaming.ts
diff options
context:
space:
mode:
authoranatawa12 <anatawa12@icloud.com>2024-07-30 19:44:08 +0900
committerGitHub <noreply@github.com>2024-07-30 19:44:08 +0900
commit8f40f932e4bac6b4a90a464041a00df315a3c693 (patch)
tree18f0a7d21de03d56e0dc730f4953d5dfb6d1ab7f /packages/backend/test/e2e/streaming.ts
parentBump version to 2024.7.0-rc.7 (diff)
downloadsharkey-8f40f932e4bac6b4a90a464041a00df315a3c693.tar.gz
sharkey-8f40f932e4bac6b4a90a464041a00df315a3c693.tar.bz2
sharkey-8f40f932e4bac6b4a90a464041a00df315a3c693.zip
自分のフォロワー限定投稿に対するリプライがホームタイムラインで見えないことが有る問題を修正 (#13835)
* fix: reply to my follower notes are not shown on the home timeline * fix: reply to follower note by non-following is on social timeline * docs: changelog * test: add endpoint test for changes * test(e2e): 自分のfollowers投稿に対するリプライが流れる * test(e2e/streaming): 自分のfollowers投稿に対するリプライが流れる * test(e2e/streaming): フォローしていないユーザによるフォロワー限定投稿に対するリプライがソーシャルタイムラインで表示されることがある問題 * test(e2e/timelines): try fixing typecheck error --------- Co-authored-by: Sayamame-beans <61457993+Sayamame-beans@users.noreply.github.com>
Diffstat (limited to 'packages/backend/test/e2e/streaming.ts')
-rw-r--r--packages/backend/test/e2e/streaming.ts62
1 files changed, 62 insertions, 0 deletions
diff --git a/packages/backend/test/e2e/streaming.ts b/packages/backend/test/e2e/streaming.ts
index b0a70074c6..72f26a38e0 100644
--- a/packages/backend/test/e2e/streaming.ts
+++ b/packages/backend/test/e2e/streaming.ts
@@ -34,6 +34,7 @@ describe('Streaming', () => {
let kyoko: misskey.entities.SignupResponse;
let chitose: misskey.entities.SignupResponse;
let kanako: misskey.entities.SignupResponse;
+ let erin: misskey.entities.SignupResponse;
// Remote users
let akari: misskey.entities.SignupResponse;
@@ -53,6 +54,7 @@ describe('Streaming', () => {
kyoko = await signup({ username: 'kyoko' });
chitose = await signup({ username: 'chitose' });
kanako = await signup({ username: 'kanako' });
+ erin = await signup({ username: 'erin' }); // erin: A generic fifth participant
akari = await signup({ username: 'akari', host: 'example.com' });
chinatsu = await signup({ username: 'chinatsu', host: 'example.com' });
@@ -71,6 +73,12 @@ describe('Streaming', () => {
// Follow: kyoko => chitose
await api('following/create', { userId: chitose.id }, kyoko);
+ // Follow: erin <=> ayano each other.
+ // erin => ayano: withReplies: true
+ await api('following/create', { userId: ayano.id, withReplies: true }, erin);
+ // ayano => erin: withReplies: false
+ await api('following/create', { userId: erin.id, withReplies: false }, ayano);
+
// Mute: chitose => kanako
await api('mute/create', { userId: kanako.id }, chitose);
@@ -297,6 +305,28 @@ describe('Streaming', () => {
assert.strictEqual(fired, true);
});
+
+ test('withReplies: true のとき自分のfollowers投稿に対するリプライが流れる', async () => {
+ const erinNote = await post(erin, { text: 'hi', visibility: 'followers' });
+ const fired = await waitFire(
+ erin, 'homeTimeline', // erin:home
+ () => api('notes/create', { text: 'hello', replyId: erinNote.id }, ayano), // ayano reply to erin's followers post
+ msg => msg.type === 'note' && msg.body.userId === ayano.id, // wait ayano
+ );
+
+ assert.strictEqual(fired, true);
+ });
+
+ test('withReplies: false でも自分の投稿に対するリプライが流れる', async () => {
+ const ayanoNote = await post(ayano, { text: 'hi', visibility: 'followers' });
+ const fired = await waitFire(
+ ayano, 'homeTimeline', // ayano:home
+ () => api('notes/create', { text: 'hello', replyId: ayanoNote.id }, erin), // erin reply to ayano's followers post
+ msg => msg.type === 'note' && msg.body.userId === erin.id, // wait erin
+ );
+
+ assert.strictEqual(fired, true);
+ });
}); // Home
describe('Local Timeline', () => {
@@ -475,6 +505,38 @@ describe('Streaming', () => {
assert.strictEqual(fired, false);
});
+
+ test('withReplies: true のとき自分のfollowers投稿に対するリプライが流れる', async () => {
+ const erinNote = await post(erin, { text: 'hi', visibility: 'followers' });
+ const fired = await waitFire(
+ erin, 'homeTimeline', // erin:home
+ () => api('notes/create', { text: 'hello', replyId: erinNote.id }, ayano), // ayano reply to erin's followers post
+ msg => msg.type === 'note' && msg.body.userId === ayano.id, // wait ayano
+ );
+
+ assert.strictEqual(fired, true);
+ });
+
+ test('withReplies: false でも自分の投稿に対するリプライが流れる', async () => {
+ const ayanoNote = await post(ayano, { text: 'hi', visibility: 'followers' });
+ const fired = await waitFire(
+ ayano, 'homeTimeline', // ayano:home
+ () => api('notes/create', { text: 'hello', replyId: ayanoNote.id }, erin), // erin reply to ayano's followers post
+ msg => msg.type === 'note' && msg.body.userId === erin.id, // wait erin
+ );
+
+ assert.strictEqual(fired, true);
+ });
+
+ test('withReplies: true のフォローしていない人のfollowersノートに対するリプライが流れない', async () => {
+ const fired = await waitFire(
+ erin, 'homeTimeline', // erin:home
+ () => api('notes/create', { text: 'hello', replyId: chitose.id }, ayano), // ayano reply to chitose's post
+ msg => msg.type === 'note' && msg.body.userId === ayano.id, // wait ayano
+ );
+
+ assert.strictEqual(fired, false);
+ });
});
describe('Global Timeline', () => {