db: permission sync generates a warning if there are no updated permissions
Created by: LawnGnome
I have no idea how my local database ended up in a state where this could be triggered, but SetRepoPendingPermissions()
has an issue where it causes a warning to be generated if there are no updated permissions to store.
Basically, if this loop doesn't append any values to updatedPerms
, one ends up building a query in updateUserPendingPermissionsBatchQuery()
that looks like this:
-- source: enterprise/internal/db/perms_store.go:updateUserPendingPermissionsBatchQuery
UPDATE user_pending_permissions
SET
object_ids_ints = update.object_ids_ints,
updated_at = update.updated_at
FROM (VALUES ) AS update (id, object_ids_ints, updated_at)
WHERE user_pending_permissions.id = update.id
Note the empty space after VALUES
where the processed updatedPerms
would be interpolated in, were there any.
I don't think there's any real user impact here, but the warnings are unsightly and annoying.