Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API: update Search endpoint to be aware of ignored users #8363

Merged

Conversation

cmrd-senya
Copy link
Member

@cmrd-senya cmrd-senya commented Jul 6, 2022

While I was using insporation I noticed that when I was looking up posts by the tag name it showed up posts by the people I block. It didn't happen in the same case for the web app.

So in this PR I fixed that.

@tclaus looks like I changed the same files as you did in #8284. It means whatever gets shipped first will create conflicts for the other. I'll try to review your PRs, especially the one I referenced.

@cmrd-senya cmrd-senya requested review from jhass and tclaus July 6, 2022 09:26
@cmrd-senya cmrd-senya marked this pull request as ready for review July 6, 2022 09:27
FactoryBot.create(
:block,
user: auth.user,
person: eve.person
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't you use someone else than eve here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, we have posts by eve and we block eve. The difference between the first and the second is that the user who is blocking is different (using a different token). This spec structure is a bit misleading, I think but I followed what was already in place

Copy link
Member

@tclaus tclaus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.
@jhass What do you think?

Copy link
Member

@SuperTux88 SuperTux88 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me, but I still have one little comment about the tests. Since it also affects all the other tests and isn't something you did new in this PR, I'm still interested in what you think about it and if you think it's worth changing or if you want to keep it the way it is.

)
expect(response.status).to eq(200)
posts = response_body_data(response)
expect(posts.length).to eq(1)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would be a good idea to actually check if the one post that gets returned here is the one that we actually expected, so there can't be a bug where there is only one post returned but it's the one from eve?

But on the other hand, all the other specs here also only check the number of posts, but I also think it would be a good idea to check more there too (for example if only public posts should be returned, check if all the posts that got returned are actually public).

@SuperTux88 SuperTux88 added this to the 0.8.0.0 milestone Aug 25, 2022
@salil-khanna
Copy link

lgtm!

@SuperTux88 SuperTux88 merged commit fddfd8b into diaspora:develop Jun 4, 2024
@SuperTux88
Copy link
Member

Merged this, as the change itself is fine 👍 and the tests are all already "bad", so maybe we should just refactor all the test at some point 🤷‍♂️

Thanks @cmrd-senya for the fix 🍪

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants