Unleash / unleash

Open-source feature management solution built for developers.
https://getunleash.io
Apache License 2.0
11.22k stars 701 forks source link

Increase size of the imageUrl for user profile picture #6025

Closed lukasz-leszczuk-airspace-intelligence closed 8 months ago

lukasz-leszczuk-airspace-intelligence commented 8 months ago

Describe the feature request

Increase allowed size (currently 255 characters) for URL to user profile photo, so that longer URLs can be used

Background

I'm using SSO from examples to login users with Google accounts and I'm adding their profile photos to unleash. Some of them are quite long, which breaks unleash update query. Added line:
await userService.store.update(user.id, {name: profile.displayName, email: email, imageUrl: photo,}); Error message:

[ERROR] error: update "users" set "name" = $1, "email" = $2, "image_url" = $3 where "deleted_at" is null and "is_service" = $4 and "is_system" = $5 and "id" = $6 - value too long for type character varying(255)
    at Object.queryBuilder (/unleash/node_modules/knex/lib/knex-builder/make-knex.js:112:26)
    at createQueryBuilder (/unleash/node_modules/knex/lib/knex-builder/make-knex.js:320:26)
    at UserStore.knex [as db] (/unleash/node_modules/knex/lib/knex-builder/make-knex.js:101:12)
    at UserStore.activeUsers (/unleash/node_modules/unleash-server/dist/lib/db/user-store.js:92:21)
    at UserStore.update (/unleash/node_modules/unleash-server/dist/lib/db/user-store.js:55:20)
    at Strategy._verify (/unleash/sso.js:26:47)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

Solution suggestions

Increase size in DB to varchar(4096) - or similar size - so that longer URLs can be set.

andreas-unleash commented 8 months ago

Hi @lukasz-leszczuk-airspace-intelligence . Seems reasonable. Let me bring this to the team and get back to you

andreas-unleash commented 8 months ago

This will be in our next release. PR here

lukasz-leszczuk-airspace-intelligence commented 8 months ago

Perfect, thank you!