Skip to content

chore(event-email): event email notification now contains link to a particular repetition #499

Merged
neSpecc merged 3 commits intomasterfrom
event-email-repetition
Dec 24, 2025
Merged

chore(event-email): event email notification now contains link to a particular repetition #499
neSpecc merged 3 commits intomasterfrom
event-email-repetition

Conversation

@neSpecc
Copy link
Copy Markdown
Member

@neSpecc neSpecc commented Dec 23, 2025

Problem

For each event we send email with link to the original event. Not the particular repetition.

Cause

Grouper was added a task to Notifier without passing a repetitionId.

Solution

  • Now we pass repetitionId from Grouper to Notifier
  • Notifier passes it to the Sender
  • Sender passes it to corresponded templates
  • Event Links now contains repetitionId
image

Introduces the repetitionId field to event notification data structures and templates, allowing emails and notifications to reference specific event repetitions. Updates TypeScript interfaces, worker logic, and email templates to support and display repetitionId where applicable.
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds support for linking to specific event repetitions in email notifications. Previously, all event emails linked to the original event regardless of which repetition triggered the notification. Now, the repetitionId is passed through the entire notification pipeline (Grouper → Notifier → Sender → Email templates) to generate URLs that point to the specific repetition that triggered the notification.

Key Changes:

  • Added repetitionId field to type definitions across the notification pipeline
  • Updated email templates to conditionally generate URLs with repetition ID when available
  • Added test assertion for the new repetitionId field

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
workers/sender/types/template-variables/event.ts Added optional repetitionId field to TemplateEventData interface
workers/sender/src/index.ts Extracts and forwards repetitionId from event data to template variables
workers/notifier/types/notifier-task.ts Added repetitionId field to NotifierEvent type
workers/notifier/types/channel.ts Added repetitionId field to SenderData interface
workers/notifier/src/index.ts Passes repetitionId from event to sender worker
workers/grouper/tests/index.test.ts Updated test to expect repetitionId: null for new events
workers/grouper/src/index.ts Converts ObjectId to string and passes repetitionId to notifier
workers/email/src/templates/emails/event/text.twig Conditionally generates URL with /repetitionId/overview when repetitionId exists
workers/email/src/templates/emails/event/html.twig Conditionally generates URL with /repetitionId/overview when repetitionId exists

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread workers/email/src/templates/emails/event/html.twig
@neSpecc neSpecc merged commit 8844840 into master Dec 24, 2025
10 checks passed
@neSpecc neSpecc deleted the event-email-repetition branch December 24, 2025 12:55
neSpecc added a commit that referenced this pull request Dec 24, 2025
…articular repetition (#499) (#502)

* Add repetitionId to event notification flow

Introduces the repetitionId field to event notification data structures and templates, allowing emails and notifications to reference specific event repetitions. Updates TypeScript interfaces, worker logic, and email templates to support and display repetitionId where applicable.

* fix grouper test

Co-authored-by: Peter <specc.dev@gmail.com>
neSpecc added a commit that referenced this pull request Dec 24, 2025
* chore(event-email): event email notification now contains link to a particular repetition  (#499)

* Add repetitionId to event notification flow

Introduces the repetitionId field to event notification data structures and templates, allowing emails and notifications to reference specific event repetitions. Updates TypeScript interfaces, worker logic, and email templates to support and display repetitionId where applicable.

* fix grouper test

* fix(sentry): replay skipping improved (#503)

* fix sentry replay skipping

* lint code

* Update index.test.ts

---------

Co-authored-by: Peter <specc.dev@gmail.com>
e11sy added a commit that referenced this pull request Feb 9, 2026
* chore(sentry): add some debug logs (#500)

* add logs to sentry worker

* tune logs

* Update index.ts

* fix tests

* chore(event-email): event email notification now contains link to a particular repetition  (#499)

* Add repetitionId to event notification flow

Introduces the repetitionId field to event notification data structures and templates, allowing emails and notifications to reference specific event repetitions. Updates TypeScript interfaces, worker logic, and email templates to support and display repetitionId where applicable.

* fix grouper test

* fix(sentry): replay skipping improved (#503)

* fix sentry replay skipping

* lint code

* Update index.test.ts

* Log Sentry client_report items for debugging (#505)

Added handling for 'client_report' items in Sentry envelopes to log their internals for easier debugging of dropped events and SDK/reporting issues. Decodes payloads as needed and logs errors if decoding fails.

* bug(sentry): Flatten nested objects in backtrace frame arguments using dot notation (#509)

* Initial plan

* Implement dot notation for nested objects in backtrace frame arguments

Co-authored-by: neSpecc <3684889+neSpecc@users.noreply.github.com>

* Fix empty array handling to be consistent with empty objects

Co-authored-by: neSpecc <3684889+neSpecc@users.noreply.github.com>

* Remove unrelated file changes that should not be affected by the solution

Co-authored-by: neSpecc <3684889+neSpecc@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: neSpecc <3684889+neSpecc@users.noreply.github.com>

* chore(setup): migrate from node 16 to 24 (#512)

* Upgrade to Node.js 24 and update TypeScript config

Update all workflows, Dockerfiles, and .nvmrc to use Node.js 24 for consistency and latest features. Enable 'moduleResolution: node' and 'skipLibCheck' in tsconfig.json to improve TypeScript compatibility and speed up builds.

* upd packages

* Update jest.setup.redis-mock.js

* Update jest.global-teardown.js

* fix tests

* Update jest.setup.redis-mock.js

* disable redis tests

* rm skip

* Update jest.config.js

* rm skips

* lint code

* Task manager (#511)

* Add Task Manager worker for auto GitHub issue creation

Introduces a new worker at workers/task-manager that automatically creates GitHub issues for events meeting a threshold, with daily rate limiting and atomic usage tracking. Includes environment setup, documentation, and updates @hawk.so/types to v0.5.3.

* Integrate GitHub issue creation and Copilot assignment

Added GitHubService for authenticating as a GitHub App and creating issues via the GitHub API. Implemented formatting of issue data from events, including stacktrace and source code snippets. Updated TaskManagerWorker to use real GitHub issue creation and Copilot assignment, replacing previous mocked logic. Added environment variables for GitHub App configuration and updated documentation. Included tests for issue formatting.

* Refactor GitHub key handling and improve Copilot assignment

Extracted GitHub App private key normalization to a utility for better reliability and CI compatibility. Enhanced Copilot assignment to use the GraphQL API and improved error handling. Refactored task creation flow to increment usage only after successful issue creation, updated dependencies, and fixed import paths.

* use pat

* Add delegated user OAuth support and token refresh for GitHub integration

Introduces delegated user-to-server OAuth support for GitHub App integration in the task manager worker. Adds logic for handling delegated user tokens, including automatic refresh and fallback to installation tokens, and updates environment/configuration to support GitHub App OAuth credentials. Updates dependencies to include @octokit/oauth-methods and related packages.

* Refactor GitHub issue creation and Copilot assignment

Separated GitHub issue creation and Copilot agent assignment into distinct steps. The issue is now always created using the GitHub App installation token, and Copilot is assigned afterward using a user-to-server OAuth token if enabled. Updated the TaskManagerWorker logic to reflect this change, improved error handling, and updated the event saving logic to accurately reflect Copilot assignment status.

* Update GithubService.ts

* lint code

* lint and tests

* Fix task manager env parsing and event timestamp filter

Replaces Number() with parseInt() for MAX_AUTO_TASKS_PER_DAY to ensure correct parsing. Fixes event query to filter by timestamp using connectedAt, and enables the super.start() call. Also corrects a typo in a comment in GrouperWorker.

* Update package.json

* update issue format

* lint

* Add PR Assistant workflow configuration (#507)

Co-authored-by: Peter <specc.dev@gmail.com>

* Update package.json

* Fix DataFilter false positives for UUIDs and MongoDB ObjectIds (#518)

* Initial plan

* Fix DataFilter to not filter UUIDs and MongoDB ObjectIds

Co-authored-by: neSpecc <3684889+neSpecc@users.noreply.github.com>

* Address code review feedback: improve UUID regex and test coverage

Co-authored-by: neSpecc <3684889+neSpecc@users.noreply.github.com>

* Fix tests to use values that would actually fail without UUID/ObjectId detection

Co-authored-by: neSpecc <3684889+neSpecc@users.noreply.github.com>

* upd version

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: neSpecc <3684889+neSpecc@users.noreply.github.com>
Co-authored-by: Peter Savchenko <specc.dev@gmail.com>

* fix(grouper): filter oldPassword and newPassword in event payload (#516)

* fix(grouper): filter oldPassword and newPassword in event payload

* chore: add more keys and update tests

* chore: lint fix

* fix(tests): rename sessionId to requestId in data-filter tests for clarity

* chore(grouper): add counters to the grouper worker

* chore(): eslint fix

* chore(): clean up

* chore(grouper): remove redundant rate-limit increment logic

* chore(grouper): remove redundant mocks

* chore(): eslint fix

* chore(): change metric type

* Update workers/grouper/src/index.ts

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* imp(): use lua for create if not exists, to avoid race-cond

---------

Co-authored-by: Peter <specc.dev@gmail.com>
Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
Co-authored-by: neSpecc <3684889+neSpecc@users.noreply.github.com>
Co-authored-by: Kuchizu <70284260+Kuchizu@users.noreply.github.com>
Co-authored-by: Dobrunia Kostrigin <48620984+Dobrunia@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
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