Skip to content
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

Increase size of the imageUrl for user profile picture #6025

Closed
lukasz-leszczuk-airspace-intelligence opened this issue Jan 24, 2024 · 3 comments
Assignees

Comments

@lukasz-leszczuk-airspace-intelligence
Copy link

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
Copy link
Contributor

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

@andreas-unleash andreas-unleash moved this from New to In Progress in Issues and PRs Jan 24, 2024
@andreas-unleash
Copy link
Contributor

This will be in our next release. PR here

@andreas-unleash andreas-unleash self-assigned this Jan 25, 2024
@andreas-unleash andreas-unleash moved this from In Progress to Done in Issues and PRs Jan 25, 2024
@lukasz-leszczuk-airspace-intelligence

Perfect, thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants