Skip to content

UW Improvements#290

Open
pauljohanneskraft wants to merge 4 commits into
mainfrom
uw-improvements
Open

UW Improvements#290
pauljohanneskraft wants to merge 4 commits into
mainfrom
uw-improvements

Conversation

@pauljohanneskraft

Copy link
Copy Markdown
Collaborator

UW Improvements

♻️ Current situation & Problem

We have encountered a couple of issues when setting up these functions in a different environment (UW). During troubleshooting, we found a couple of small improvements and fixes and want to bring them to the original repository as well.

⚙️ Release Notes

  • Extract SSO email address from either event.data.email or from the provider's claims of the credential.
  • Make sure the scheduled functions do not fail, if one of their operations fails. This makes sure that, e.g. the scheduled function every morning still seeds the database initially, even if the Twilio credentials are invalid.

Code of Conduct & Contributing Guidelines

By creating and submitting this pull request, you agree to follow our Code of Conduct and Contributing Guidelines:

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 comprehensive error handling to async operations in two critical areas: the scheduled morning tasks and user authentication flow. The changes ensure that failures in individual operations don't cause cascading failures and are properly logged for debugging.

  • Added .catch() handlers with logging to all promises in everyMorning() method
  • Enhanced email address extraction to support SSO credential claims (upn and unique_name)
  • Added validation using Zod schema for email address parsing

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.

File Description
functions/src/services/trigger/triggerService.ts Added individual error handlers with logging to all async operations in Promise.all
functions/src/functions/blocking.ts Enhanced email extraction logic to handle SSO credentials and added validation with error handling

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

Comment thread functions/src/services/trigger/triggerService.ts
Comment thread functions/src/functions/blocking.ts Outdated
Comment thread functions/src/functions/blocking.ts
Comment thread functions/src/functions/blocking.ts
@codecov

codecov Bot commented Oct 29, 2025

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 24 lines in your changes missing coverage. Please review.
✅ Project coverage is 81.67%. Comparing base (8624b3f) to head (55b61c0).

Files with missing lines Patch % Lines
functions/src/functions/blocking.ts 0.00% 11 Missing and 1 partial ⚠️
functions/src/services/trigger/triggerService.ts 0.00% 12 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #290      +/-   ##
==========================================
- Coverage   82.43%   81.67%   -0.75%     
==========================================
  Files          91       91              
  Lines        3607     3627      +20     
  Branches      894      897       +3     
==========================================
- Hits         2973     2962      -11     
- Misses        600      631      +31     
  Partials       34       34              
Files with missing lines Coverage Δ
functions/src/functions/blocking.ts 0.00% <0.00%> (ø)
functions/src/services/trigger/triggerService.ts 75.61% <0.00%> (-4.02%) ⬇️

... and 1 file with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8624b3f...55b61c0. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@PSchmiedmayer PSchmiedmayer left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Looks great; thank you @pauljohanneskraft 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants