Skip to content

Conversation

@mariojsnunes
Copy link
Contributor

@mariojsnunes mariojsnunes commented Jan 18, 2026

PR Checklist

  • - Unit and/or e2e tests for the changes that have been added (for bug fixes / features)

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Refactoring (no functional changes)

What is the new behavior?

Emails are sent in batches of 100.
This should solve some emails not being sent due to hitting resend limits.

The new approach brings the resend code to our server, instead of using the edge function.

Does this PR introduce a DB Schema Change or Migration?

  • Yes

Git Issues

Closes #

@mariojsnunes mariojsnunes added the Review allow-preview ✅ Has received manual check for malicious code and can be safely built for preview label Jan 18, 2026
@cypress
Copy link

cypress bot commented Jan 18, 2026

onearmy-community-platform    Run #8447

Run Properties:  status check failed Failed #8447  •  git commit 34ad9d5149: fix a few cy tests
Project onearmy-community-platform
Branch Review feat/refactor-notifications-batch
Run status status check failed Failed #8447
Run duration 10m 05s
Commit git commit 34ad9d5149: fix a few cy tests
Committer Mário Nunes
View all properties for this run ↗︎

Test results
Tests that failed  Failures 1
Tests that were flaky  Flaky 1
Tests that did not run due to a developer annotating a test with .skip  Pending 0
Tests that did not run due to a failure in a mocha hook  Skipped 0
Tests that passed  Passing 93
View all changes introduced in this branch ↗︎

Tests for review

Failed  src/integration/research/read.spec.ts • 1 failed test • ci-chrome

View Output Video

Test Artifacts
... > [Visible to everyone] Test Replay Screenshots Video
Flakiness  src/integration/settings.spec.ts • 1 flaky test • ci-chrome

View Output Video

Test Artifacts
[Settings] > Can create member Test Replay Screenshots Video

@benfurber benfurber moved this from 🆕 Backlog to In progress in Core Team - BAU list Jan 19, 2026
Comment on lines -26 to -29
token?: string;
token_hash?: string;
token_new?: string;
token_hash_new?: string;
Copy link
Member

Choose a reason for hiding this comment

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

Aren't these auth focused?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

They are not being used as far as I can see.

Copy link
Member

@benfurber benfurber left a comment

Choose a reason for hiding this comment

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

Looking good.

My worry about the responsibility of the SQL function current is that it's hard to follow. Can't the validating the user email preferences stay a TS service focused?

(I'm sure it's on your list already but looks like a bunch of code can be removed from the edge function folder.)

@mariojsnunes
Copy link
Contributor Author

My worry about the responsibility of the SQL function current is that it's hard to follow. Can't the validating the user email preferences stay a TS service focused?

Before we were doing 1 query per user (and was still an sql function because needs access to auth.users).
Could split the query into 2:

  • Get the subscribers profileIds
  • Get emails corresponding to those profileIds

But I don't see a benefit to that, the 2nd query especially would be longer: select email from x where profile_id IN ({all profile ids, which could be hundreds})

But I'll look into making it more readable.

@mariojsnunes mariojsnunes added Review allow-preview ✅ Has received manual check for malicious code and can be safely built for preview and removed Review allow-preview ✅ Has received manual check for malicious code and can be safely built for preview labels Jan 22, 2026
@mariojsnunes mariojsnunes removed the Review allow-preview ✅ Has received manual check for malicious code and can be safely built for preview label Jan 23, 2026
@mariojsnunes mariojsnunes added the Review allow-preview ✅ Has received manual check for malicious code and can be safely built for preview label Jan 23, 2026
@mariojsnunes mariojsnunes removed the Review allow-preview ✅ Has received manual check for malicious code and can be safely built for preview label Jan 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status
Status: In progress

Development

Successfully merging this pull request may close these issues.

3 participants