Skip to content

Master -> dev#90

Merged
jmgasper merged 16 commits intodevelopfrom
master
Mar 26, 2026
Merged

Master -> dev#90
jmgasper merged 16 commits intodevelopfrom
master

Conversation

@kkartunov
Copy link
Copy Markdown
Contributor

No description provided.

@kkartunov kkartunov requested a review from jmgasper March 2, 2026 07:18

echo "Running Prisma migrations..."

if [ -z "$DATABASE_URL" ]; then
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[❗❗ 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})"
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[⚠️ 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
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[⚠️ 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"
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[❗❗ 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?
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[❗❗ 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?
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[❗❗ 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.

@kkartunov
Copy link
Copy Markdown
Contributor Author

@jmgasper shall we sync dev with master? Want to keep things in sync...

userId BigInt
trackId String
typeId String
trackId String?
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[❗❗ 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?
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[❗❗ 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()
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[💡 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()
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[💡 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
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[⚠️ 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: ' ',
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[⚠️ 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.

@jmgasper jmgasper merged commit 2b3b4ff into develop Mar 26, 2026
6 of 7 checks passed
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