Skip to content

Conversation

slint
Copy link
Member

@slint slint commented Sep 5, 2024

  • Uses search results to determine a blocked/restored user's
    communities.
  • Uses TaskOp and Unit of Work for sending off action tasks.

* Uses search results to determine a blocked/restored user's
  communities.
* Uses TaskOp and Unit of Work for sending off action tasks.
Comment on lines +29 to +42
if from_db:
query = db.session.query(mem_model_cls.community_id).filter(
mem_model_cls.user_id == user_id,
mem_model_cls.role == "owner",
)
return (row[0] for row in query.yield_per(1000))
else:
search = (
RecordsSearchV2(index=mem_cls.index._name)
.filter("term", user_id=user_id)
.filter("term", role="owner")
.source(["community_id"])
)
return (hit["community_id"] for hit in search.scan())
Copy link
Contributor

Choose a reason for hiding this comment

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

Major: Hmm I think we are missing the filtering for the communities that are owned solely by the user, unless I am missing something?

Copy link
Member Author

Choose a reason for hiding this comment

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

You're right, this doesn't check anymore if the user is the only owner. Part of the change was to improve on the overall performance (before there was some in-memory overfetching). I think adding the check back is not that big of a performance hit, so I'll have a go at it.

@slint slint moved this from Ready to Backlog 😴 in Sprint Q3/2025 ☀️ Mar 4, 2025
@slint slint moved this to Backlog 😴 in Sprint Q3/2025 ☀️ Jul 21, 2025
@carlinmack carlinmack moved this from Backlog 😴 to Ready in Sprint Q3/2025 ☀️ Jul 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Ready
Development

Successfully merging this pull request may close these issues.

2 participants