Skip to content

fix: do not try to load profile image from param for self - #8605

Merged
link2xt merged 1 commit into
mainfrom
link2xt/no-self-param-profile-image
Aug 27, 2026
Merged

fix: do not try to load profile image from param for self#8605
link2xt merged 1 commit into
mainfrom
link2xt/no-self-param-profile-image

Conversation

@link2xt

@link2xt link2xt commented Aug 19, 2026

Copy link
Copy Markdown
Collaborator

I have an old profile which has ProfileImage param set on the reserved SELF contact. When I deleted
an avatar from the profile, very old profile image showed up in the settings in Delta Chat Desktop instead, which can be "deleted" again without any result.

This fix is to return None early from get_profile_image_ext for self contact without trying to load the parameter. Fallthrough to loading params was likely there
since keycontacts and grey avatars for address contacts introduction in 416131b

@link2xt link2xt added the bug Something is not working label Aug 19, 2026
I have an old profile which has ProfileImage param
set on the reserved SELF contact.  When I deleted
an avatar from the profile, very old profile image
showed up in the settings in Delta Chat Desktop instead,
which can be "deleted" again without any result.

This fix is to return `None` early from get_profile_image_ext
for self contact without trying to load the parameter.
Fallthrough to loading params was likely there
since keycontacts and grey avatars for address contacts
introduction in 416131b
@link2xt
link2xt force-pushed the link2xt/no-self-param-profile-image branch from 2570e5b to 2d542ce Compare August 19, 2026 08:17
@link2xt
link2xt marked this pull request as ready for review August 19, 2026 08:19
@link2xt

link2xt commented Aug 19, 2026

Copy link
Copy Markdown
Collaborator Author

Could even be it is also some result of me doing development on this profile at some point long ago, so it is really minor. Or it is very uncommon to delete an avatar without a replacement. I also deleted all params from the database for self contact locally now to be sure.

@hpk42 hpk42 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

lgtm, but two notes: would have been easier to review if you didn't also refactor the structure (which makes sense, and is fine). The other minor nit is that it would be nice to remove Param::ProfileImage maybe just on the fly, or maybe keep it on a list for some future migration that maybe also cleans up other historic oddities.

@link2xt

link2xt commented Aug 27, 2026

Copy link
Copy Markdown
Collaborator Author

lgtm, but two notes: would have been easier to review if you didn't also refactor the structure (which makes sense, and is fine).

Yes, it is to make it visible that there is no fallthrough anywhere, as the bug was caused by fallthrough from the first if.

The other minor nit is that it would be nice to remove Param::ProfileImage maybe just on the fly, or maybe keep it on a list for some future migration that maybe also cleans up other historic oddities.

I only cleaned this parameter locally to be 100% sure i'm not sending old avatar and not have it appear until the bugfix is released. For all users i think it's too risky to clean up things like this and there is nothing visible as the result. E.g. in this case we want to cleanup the parameter we will need to open a write transaction and re-read the parameter there, otherwise may accidentally revert some change from another thread. We also have columns in the database that cannot be removed because when we tried some phones failed to run migrations as they ran out of space/memory.

For some cleanup, i did a follow-up to remove unused avatar file in housekeeping: #8634

@link2xt
link2xt merged commit 693c404 into main Aug 27, 2026
30 checks passed
@link2xt
link2xt deleted the link2xt/no-self-param-profile-image branch August 27, 2026 21:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something is not working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants