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

feat: add new notification columns to User #2263

Merged
merged 5 commits into from
Sep 20, 2024
Merged

Conversation

omBratteng
Copy link
Member

@omBratteng omBratteng commented Sep 18, 2024

Extends user table to add two new columns, followingEmail and followNotifications

AS-584

@omBratteng omBratteng requested review from capJavert and a team as code owners September 18, 2024 20:40
@omBratteng omBratteng changed the title feat: add new notification columns feat: add new notification columns to User Sep 18, 2024
src/routes/boot.ts Show resolved Hide resolved
name = 'User1726691862710'

public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`ALTER TABLE "user" ADD "followingEmail" boolean NOT NULL DEFAULT true`);
Copy link
Contributor

Choose a reason for hiding this comment

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

Just thinking is there any case where we want to consider false now?
I do think when someone turned off all emails for instance or all push this should be false... Maybe something to consider in the migration (should be a easy query)

From FE it should work the same.
Turning the main email off should turn off all sub emails immediatly.

CC: @capJavert fyi

Copy link
Contributor

Choose a reason for hiding this comment

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

I agree, we can do once of UPDATE query or script but we need to check with product because they usually don't like emails off 🙈

Copy link
Contributor

@capJavert capJavert Sep 19, 2024

Choose a reason for hiding this comment

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

@omBratteng can you test/prepare the query on your end and we can run it once before we go live? (product confirmed it should act like Chris mentioned)

Copy link
Member Author

Choose a reason for hiding this comment

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

@capJavert do we only want to check for the Activity and Community updates, or also personalized digest?
Because when email notifications are "Off", all of them are off. But if you enable digest, it technically back on.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think the first one is fine for now

Copy link
Member Author

Choose a reason for hiding this comment

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

For push notifications it's either on or it's not. So there we could just keep it on as default

Copy link
Member Author

Choose a reason for hiding this comment

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

We should probably run it manually in batches. Once when this is merged, and once just as we go live to catch any changes that might've been done while UI wasn't in place

Copy link
Contributor

@capJavert capJavert Sep 19, 2024

Choose a reason for hiding this comment

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

👍 Batches yes, user table can block a lot of things.

Copy link
Member Author

Choose a reason for hiding this comment

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

Anything else missing from the PR?

Copy link
Member Author

@omBratteng omBratteng Sep 19, 2024

Choose a reason for hiding this comment

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

Easier to run a query to turn it off for 120k users, then a query to enable it for the other 870k that has either enabled

@capJavert
Copy link
Contributor

Some more tests need to be updated I think.

@omBratteng omBratteng enabled auto-merge (squash) September 20, 2024 08:20
@omBratteng omBratteng merged commit bd074d3 into main Sep 20, 2024
8 checks passed
@omBratteng omBratteng deleted the AS-584-new-notifications branch September 20, 2024 08:24
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.

3 participants