Skip to content

Conversation

@ArtyomSavchenko
Copy link
Member

@ArtyomSavchenko ArtyomSavchenko commented Nov 14, 2025

Screenshot 2025-11-14 at 17 11 22

Signed-off-by: Artem Savchenko <armisav@gmail.com>
@huly-github-staging
Copy link

Connected to Huly®: UBERF-14075

Copy link
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 addresses bandwidth constraint errors in the LiveKit billing system by handling null bandwidth values. The fix includes both application-level null handling and database schema updates to prevent constraint violations.

  • Adds nullish coalescing operator to handle null/undefined bandwidth values in the insert/upsert logic
  • Introduces a new migration (migrationV3) to update existing null bandwidth values to 0 and set a DEFAULT constraint
  • Modifies the original table creation migration to include DEFAULT 0 for bandwidth

Reviewed Changes

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

File Description
services/billing/pod-billing/src/db/postgres.ts Added null coalescing (?? 0) when inserting bandwidth values to prevent constraint violations
services/billing/pod-billing/src/db/migrations.ts Added migrationV3 to fix existing null values and set DEFAULT constraint; modified migrationV1 to include DEFAULT in initial table creation

Signed-off-by: Artem Savchenko <armisav@gmail.com>
@ArtyomSavchenko ArtyomSavchenko merged commit 0592bf5 into develop Nov 17, 2025
15 checks passed
@aonnikov aonnikov deleted the fix-bandwidth-null branch November 17, 2025 06:41
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.

4 participants