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

Store a MD5 hash of content for stored messages #187

Merged
merged 5 commits into from
Sep 10, 2024
Merged

Conversation

jb3
Copy link
Member

@jb3 jb3 commented Sep 10, 2024

Storing an MD5 hash of content allows us to perform tasks related to the content of identical messages without compromising our promise of privacy and not storing actual user generated content.

With this field, we can:

  • Look for instances of same-channel spam
  • Look for instances of cross-channel spam
  • Factor these into when we make a voice verification decision (i.e. if there is reason to believe a user has spammed, hold off from verifying until a Moderator has reviewed the case)
  • Look for multiple users spamming the same message

Copy link
Member

@ChrisLovering ChrisLovering left a comment

Choose a reason for hiding this comment

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

Just one comment on top of the ruff required changes


def upgrade() -> None:
"""Apply the current migration."""
op.add_column("messages", sa.Column("content_hash", sa.String(), nullable=False))
Copy link
Member

Choose a reason for hiding this comment

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

You'll need to either define a default value here, or add a migration so that existing rows meet the NOT NULL constraint added by setting nullable=False here

@jb3 jb3 force-pushed the jb3/features/content-hash branch from 6fc204b to bfa0ae3 Compare September 10, 2024 16:03
ChrisLovering
ChrisLovering previously approved these changes Sep 10, 2024
Copy link
Member

@ChrisLovering ChrisLovering left a comment

Choose a reason for hiding this comment

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

lgtm

@jb3 jb3 merged commit 60164d8 into main Sep 10, 2024
2 checks passed
@jb3 jb3 deleted the jb3/features/content-hash branch September 10, 2024 16:08
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.

2 participants