Conversation
[PROD RELEASE] - Jan 26
[PROD RELEASE] - Fix traits
[PROD DEBUG ]debug bd url -> master
[PROD RELEASE] - Fixes
[PROD RELEASE] - Access & fixes
Update config.yml -> master
[PROD RELEASE] - Bug fixes & updates
[PROD RELEASE] - Profile app & fixes
Don't backfill right away since we aren't using that data just yet
Allow these to be nullable for the time being
|
|
||
| echo "Running Prisma migrations..." | ||
|
|
||
| if [ -z "$DATABASE_URL" ]; then |
There was a problem hiding this comment.
[❗❗ correctness]
Consider using -z "$DATABASE_URL" to check if DATABASE_URL is unset or empty. This ensures that the script behaves correctly even if DATABASE_URL is set but empty.
| # Optional: print sanitized env vars to help debug | ||
| # env | grep -v "PASSWORD\|SECRET\|KEY\|TOKEN" | ||
| else | ||
| echo "DATABASE_URL is present (length: ${#DATABASE_URL})" |
There was a problem hiding this comment.
[security]
Printing the length of DATABASE_URL might not be necessary and could expose sensitive information about the environment setup. Consider removing this line or ensuring it doesn't inadvertently leak information.
| ALTER TABLE "members"."memberStats" | ||
| ALTER COLUMN "trackId" SET NOT NULL, | ||
| ALTER COLUMN "typeId" SET NOT NULL; | ||
| -- -- ValidateBackfillPrerequisites |
There was a problem hiding this comment.
[maintainability]
The entire backfill logic has been commented out. Ensure that this is intentional and that the backfill is no longer required. If this logic is still needed, consider moving it to a separate migration or script to maintain clarity and separation of concerns.
| -- WHERE ms."trackId" IS NULL OR ms."typeId" IS NULL; | ||
|
|
||
| -- -- AlterTable | ||
| -- ALTER TABLE "members"."memberStats" |
There was a problem hiding this comment.
[❗❗ correctness]
The ALTER TABLE statements to set trackId and typeId as NOT NULL are commented out. Ensure that these constraints are no longer necessary. If they are needed for data integrity, consider re-enabling them or handling them in a different way.
| userId BigInt | ||
| trackId String | ||
| typeId String | ||
| trackId String? |
There was a problem hiding this comment.
[❗❗ correctness]
Changing trackId from String to String? makes it nullable. Ensure that the application logic correctly handles cases where trackId is null, as this could impact data integrity or application behavior.
| trackId String | ||
| typeId String | ||
| trackId String? | ||
| typeId String? |
There was a problem hiding this comment.
[❗❗ correctness]
Changing typeId from String to String? makes it nullable. Verify that all parts of the application that rely on typeId can handle null values appropriately to prevent potential errors or unexpected behavior.
|
@jmgasper shall we sync dev with master? Want to keep things in sync... |
[PROD RELEASE] - Updates & fixes
[PROD RELEASE] - AI Review/Updates & Fixes
| userId BigInt | ||
| trackId String | ||
| typeId String | ||
| trackId String? |
There was a problem hiding this comment.
[❗❗ correctness]
Changing trackId from String to String? makes it nullable. Ensure that this change aligns with the business logic and that any code interacting with this field can handle null values appropriately.
| trackId String | ||
| typeId String | ||
| trackId String? | ||
| typeId String? |
There was a problem hiding this comment.
[❗❗ correctness]
Changing typeId from String to String? makes it nullable. Verify that this change is intentional and that all related logic can accommodate null values without causing errors.
|
|
||
| let selectedRating = null | ||
| statsRows.forEach((row) => { | ||
| const trackId = _.isNil(row && row.trackId) ? '' : String(row.trackId).trim() |
There was a problem hiding this comment.
[💡 readability]
The use of _.isNil(row && row.trackId) is redundant. Since row is already checked for nullish values, you can simplify this to _.isNil(row.trackId).
| let selectedRating = null | ||
| statsRows.forEach((row) => { | ||
| const trackId = _.isNil(row && row.trackId) ? '' : String(row.trackId).trim() | ||
| const typeId = _.isNil(row && row.typeId) ? '' : String(row.typeId).trim() |
There was a problem hiding this comment.
[💡 readability]
The use of _.isNil(row && row.typeId) is redundant. Since row is already checked for nullish values, you can simplify this to _.isNil(row.typeId).
| }) | ||
|
|
||
| return selectedRating | ||
| return selectedRating || maxRating || null |
There was a problem hiding this comment.
[correctness]
The return statement return selectedRating || maxRating || null could potentially return maxRating even if selectedRating is null. Ensure this is the intended behavior, as it changes the logic from the previous implementation.
| mostRecentEventDate: new Date('2026-03-20T00:00:00.000Z') | ||
| }, | ||
| { | ||
| trackId: ' ', |
There was a problem hiding this comment.
[correctness]
The trackId value is a string with spaces, which might not be handled correctly by convertMember. Consider trimming the string or checking for non-empty values to ensure the logic correctly identifies malformed rows.
No description provided.