Skip to content
Michael Keenan edited this page Jan 30, 2024 · 8 revisions

Stop-gap ops wiki

To be moved to some shared space with other ForumMagnum instances

How to make comment fully publicly invisible

This assumes the comment was previously deleted by admin/moderator through the UI and now is tombstoned

UPDATE "Comments" SET deleted = true WHERE _id = '<commentId>';
UPDATE "Comments" SET "deletedPublic" = false WHERE _id = '<commentId>';

How to get WAU and MAU

(Moved to SQL queries for stats

The manual procedure for deleting personally identifying data

TBD whether we'll actually delete entire rows, or just delete the identifying fields. But for now, do this:

Unsubscribe the user from any Sendgrid lists they might be on. The Deactivate User checkbox on their account settings page will do it, or you can log in to Sendgrid and remove them (in Marketing/Contacts, search by email address).

First get the userId:

SELECT _id FROM "Users" WHERE email = '[email protected]';

Then check whether the user has any posts with that userId, comments with that userId, or revisions with that documentId. Posts and comments can be soft-deleted with the deleteComment function (which you can run by checking the Delete Content checkbox on the user's account when you're an admin).

Then clear the user data:

UPDATE "Users" SET
"username" = null,
"displayName" = null,
"previousDisplayName" = null,
"fullName" = null,
"email" = null,
"emails" = null,
"profile" = null,
"services" = null,
slug = null,
"oldSlugs" = null,
"lastUsedTimezone" = null,
"mapLocation" = null,
"mapMarkerText" = null,
"htmlMapMarkerText" = null,
"paymentEmail" = null,
"paymentInfo" = null,
"profileImageId" = null,
"profileTagIds" = '{}'::jsonb[],
wu_uuid = null,
first_name = null,
last_name = null,
avatar = null,
biography = null,
biography_latest = null,
"bookmarkedPostsMetadata" = '{}'::jsonb[]
WHERE email = '[email protected]';

And then check whether they have any Revisions:

SELECT COUNT(*) FROM "Revisions" WHERE "documentId" = 'theId';

If they do, figure out what to do about it, do that, and then document it here.

Misc

  • Your deployment will fail if the last commit message contains an emoji (or probably any non-ascii character)
    • todo add specific error to make it searcheable