-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weโll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[PM-13693] Fixed null warnings #4896
base: main
Are you sure you want to change the base?
Changes from 9 commits
5360cba
09e9adf
11972ca
8a42c87
097eafb
f6b0234
4b47e62
9a759ed
0cbbc84
2fd6ea3
218e417
3c785aa
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,9 +28,9 @@ from su in su_g.DefaultIfEmpty() | |
SsoExternalId = x.su.ExternalId, | ||
Permissions = x.ou.Permissions, | ||
ResetPasswordKey = x.ou.ResetPasswordKey, | ||
UsesKeyConnector = x.u != null && x.u.UsesKeyConnector, | ||
UsesKeyConnector = x.u.UsesKeyConnector, | ||
AccessSecretsManager = x.ou.AccessSecretsManager, | ||
HasMasterPassword = x.u != null && !string.IsNullOrWhiteSpace(x.u.MasterPassword) | ||
HasMasterPassword = !string.IsNullOrWhiteSpace(x.u.MasterPassword) | ||
Comment on lines
+31
to
+33
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Generated SQLite from before change SELECT "o"."Id",
"o"."UserId",
"o"."OrganizationId",
"u"."Name",
COALESCE("u"."Email", "o"."Email") AS "Email",
"u"."AvatarColor",
"u"."TwoFactorProviders",
"u"."Premium",
"o"."Status",
"o"."Type",
"o"."ExternalId",
"s"."ExternalId" AS "SsoExternalId",
"o"."Permissions",
"o"."ResetPasswordKey",
"u"."Id" IS NOT NULL AND "u"."UsesKeyConnector" AS "UsesKeyConnector",
"o"."AccessSecretsManager",
"u"."Id" IS NOT NULL AND "u"."MasterPassword" IS NOT NULL AND trim("u"."MasterPassword") <> 'P|CfDJ8KUSA3v4Y1dFg8Rnf6FjA5fdvqaglKtClSQ1I3diP2vxzTdwq2_dCgDHF-chiyxdEEkJZ_XZnvZFhIpQGoqQL4f35sOzasRWeL8HXy0O59nSBVpX2WOp565OeY4fYRwuNg' AS "HasMasterPassword"
FROM "OrganizationUser" AS "o"
LEFT JOIN "User" AS "u" ON "o"."UserId" = "u"."Id"
LEFT JOIN "SsoUser" AS "s" ON "o"."UserId" = "s"."UserId" AND "o"."OrganizationId" = "s"."OrganizationId" After change: SELECT "o"."Id",
"o"."UserId",
"o"."OrganizationId",
"u"."Name",
COALESCE("u"."Email",
"o"."Email") AS "Email",
"u"."AvatarColor",
"u"."TwoFactorProviders",
"u"."Premium",
"o"."Status",
"o"."Type",
"o"."ExternalId",
"s"."ExternalId" AS "SsoExternalId",
"o"."Permissions",
"o"."ResetPasswordKey",
"u"."UsesKeyConnector",
"o"."AccessSecretsManager",
"u"."MasterPassword" IS NOT NULL AND trim("u"."MasterPassword") <> 'P|CfDJ8KUSA3v4Y1dFg8Rnf6FjA5dJYW3Rjd8aosV-K01yVWmZVkVbItCW4oOuqXMvKO2PD9DIw0XKjy8sqgWtIKF1q7cT1JKgc3F2mwImAtRqP5WfrlURovVo9WdKmv2sI9lHUg' AS "HasMasterPassword"
FROM "OrganizationUser" AS "o"
LEFT JOIN "User" AS "u" ON "o"."UserId" = "u"."Id"
LEFT JOIN "SsoUser" AS "s" ON "o"."UserId" = "s"."UserId" AND "o"."OrganizationId" = "s"."OrganizationId" And the equivalent hand wrote SQL: SELECT
OU.[Id],
OU.[UserId],
OU.[OrganizationId],
U.[Name],
ISNULL(U.[Email], OU.[Email]) Email,
U.[AvatarColor],
U.[TwoFactorProviders],
U.[Premium],
OU.[Status],
OU.[Type],
OU.[AccessSecretsManager],
OU.[ExternalId],
SU.[ExternalId] SsoExternalId,
OU.[Permissions],
OU.[ResetPasswordKey],
U.[UsesKeyConnector],
CASE WHEN U.[MasterPassword] IS NOT NULL THEN 1 ELSE 0 END AS HasMasterPassword
FROM
[dbo].[OrganizationUser] OU
LEFT JOIN
[dbo].[User] U ON U.[Id] = OU.[UserId]
LEFT JOIN
[dbo].[SsoUser] SU ON SU.[UserId] = OU.[UserId] AND SU.[OrganizationId] = OU.[OrganizationId] So this seems like a good change to me. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I also double checked this because I was concerned about orgUsers in the invited state that are not linked to a user, but they're excluded by the inner join on |
||
}); | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Love this change, I really dislike trying to grab info from the first item in a list. Much nicer this way.