Skip to content

New reupload logic for user display pics#588

Merged
mpretty-cyro merged 37 commits into
session-foundation:devfrom
mpretty-cyro:feature/profile-pic-reupload-changes
Oct 28, 2025
Merged

New reupload logic for user display pics#588
mpretty-cyro merged 37 commits into
session-foundation:devfrom
mpretty-cyro:feature/profile-pic-reupload-changes

Conversation

@mpretty-cyro

@mpretty-cyro mpretty-cyro commented Sep 24, 2025

Copy link
Copy Markdown
Collaborator
  • Pulled across a few changes from the refactored networking
  • Pulled across the profile_updated changes from the animated profile pictures PR
  • Added libWebP and SDWebImageWebPCoder for WebP encoding
  • Added an icon option to the ImageDataManager
  • Added code to filter out Giphy results which won't be rendered
  • Added thumbnailing logic for animated images (shaving a decent amount of memory usage from the media grid)
  • Added more details to profile update logs (also added debug logs for updating other users profiles)
  • Added a delay before killing the app after clearing data to give the libSession logger more time to shutdown (false crash reports)
  • Removed some emoji encoding which is no longer needed
  • Renamed the UpdateProfilePictureJob to ReuploadUserDisplayPictureJob
  • Refactored "SignalAttachment" to be "PendingAttachment" and "ProcessedAttachment"
  • Simplified the ImageDataManager to use a single FrameBuffer type instead of varying ProcessedImageData types
  • Updated display picture editing to use ImageDataManager.DataSource where possible (avoid loading as data)
  • Updated the group creation and display picture update processes to be (mostly) async/await
  • Updated PhotoLibrary attachment processing to be async/await
  • Updated the main logic in AttachmentUploadJob to be async/await
  • Fixed an issue where link previews wouldn't render correctly
  • Fixed an issue where old display pictures wouldn't be removed when replaced
  • Fixed a minor modal button layout issue
  • Fixed a missing string variable issue
  • Fixed a bug where restoring an account would clear the users display picture

• Started working on the updated logic for the ReuploadUserDisplayPictureJob
• Pulled across a few changes from the refactored networking
• Pulled across the profile_updated changes from the animated profile pictures PR
@mpretty-cyro mpretty-cyro self-assigned this Sep 24, 2025
@mpretty-cyro mpretty-cyro added enhancement New feature or request Jira This ticket is being tracked in Jira labels Sep 24, 2025
• Refactored "SignalAttachment" to be "PendingAttachment" and "ProcessedAttachment"
• Added libWebP and SDWebImageWebPCoder for WebP encoding
• Added an `icon` option to the ImageDataManager
• Updated display picture editing to use `ImageDataManager.DataSource` where possible (avoid loading as data)
• Updated the group creation and display picture update processes to be (mostly) async/await
• Updated PhotoLibrary attachment processing to be async/await
• Updated the main logic in AttachmentUploadJob to be async/await
• Fixed an issue where link previews wouldn't render correctly
• Added deterministic attachment encryption/decryption
• Refactored the logic in the AttachmentUploadJob to be more reusable
• Refactored the upload logic in the AttachmentUploadJob to not require the database (so the Share Extension can more easily use it when that database relocation work continues)
• Refactored the AttachmentDownloadJob to use async/await internally
• Refactored the DisplayPictureDownloadJob to be (partially) async/await internally
• Fixed a few issues with uploading attachments
• Started adding dev settings to enable deterministic encryption and set a custom file server for testing
• Fixed a bug where the display picture upload would never dismiss the loader
• Fixed a bug where we were using the wrong legacy encryption for the display picture
• Wired up the dev settings
• Update logic to use an ed25519 key for the FileServer instead of an x25519 one
• Updated the ReuploadUserDisplayPictureJob to wait for the first poll to succeed before running (to reduce config conflict issues)
• Fixed a bug with the FileServer extend API call
• Fixed an issue with the CI build script
• Fixed an incorrect search icon on the home screen
• Fixed an issue where the "Join Community" button didn't have a disabled state
• Added logic to convert between desired file types
• Added logic to convert display pictures to desired formats (with timeouts when initially setting)
• Refactored the ThreadPickerVC message sending to be (partially) async/await
• Removed some duplicate code
• Resolved remaining TODOs
• Fixed unit test compilation issues
• Fixed some error handling
• Tweaked the logic to skip re-processing of either WebP or GIF
• Fixed the DisplayPictureDownload unit tests
# Conflicts:
#	Session.xcodeproj/project.pbxproj
#	Session.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved
#	Session/Conversations/ConversationVC+Interaction.swift
#	Session/Conversations/Input View/InputView.swift
#	Session/Conversations/Settings/ThreadSettingsViewModel.swift
#	Session/Media Viewing & Editing/MediaPageViewController.swift
#	Session/Settings/DeveloperSettings/DeveloperSettingsViewModel.swift
#	Session/Settings/SettingsViewModel.swift
#	SessionMessagingKit/Database/Migrations/_045_LastProfileUpdateTimestamp.swift
#	SessionMessagingKit/Database/Models/Profile.swift
#	SessionMessagingKit/Jobs/DisplayPictureDownloadJob.swift
#	SessionMessagingKit/Jobs/UpdateProfilePictureJob.swift
#	SessionMessagingKit/LibSession/Config Handling/LibSession+Contacts.swift
#	SessionMessagingKit/LibSession/Config Handling/LibSession+GroupMembers.swift
#	SessionMessagingKit/LibSession/Config Handling/LibSession+UserProfile.swift
#	SessionMessagingKit/Messages/Visible Messages/VisibleMessage+Profile.swift
#	SessionMessagingKit/Protos/SessionProtos.proto
#	SessionMessagingKit/Sending & Receiving/AttachmentUploader.swift
#	SessionMessagingKit/Sending & Receiving/Attachments/SignalAttachment.swift
#	SessionMessagingKit/Sending & Receiving/Message Handling/MessageReceiver+Groups.swift
#	SessionMessagingKit/Sending & Receiving/Message Handling/MessageSender+Groups.swift
#	SessionMessagingKit/Utilities/DisplayPictureManager.swift
#	SessionMessagingKit/Utilities/Profile+Updating.swift
#	SessionMessagingKitTests/Jobs/DisplayPictureDownloadJobSpec.swift
#	SessionMessagingKitTests/Sending & Receiving/MessageReceiverGroupsSpec.swift
#	SessionMessagingKitTests/Sending & Receiving/MessageSenderGroupsSpec.swift
#	SessionMessagingKitTests/Sending & Receiving/Pollers/CommunityPollerSpec.swift
#	SessionNetworkingKit/FileServer/FileServerAPI.swift
#	SessionNetworkingKit/Models/FileUploadResponse.swift
#	SessionTests/Onboarding/OnboardingSpec.swift
#	SessionUIKit/Components/Input View/InputTextView.swift
#	SessionUIKit/Components/Modals & Toast/ConfirmationModal.swift
#	SessionUIKit/Components/ProfilePictureView.swift
#	SessionUtilitiesKit/General/Feature.swift
#	SignalUtilitiesKit/Media Viewing & Editing/Attachment Approval/AttachmentTextToolbar.swift
• Updated the AttachmentDownloadJob to rely solely on the `useDeterministicEncryption` flag to decide which encryption to use
• Updated the logic to clean up temporary files a bit more readily
• Updated to the latest libSession version
• Fixed an issue where non-animated WebP conversion was failing
• Fixed an orientation issue after converting photos to WebP
• Added thumbnailing logic for animated images (shaving a decent amount of memory usage from the media grid)
• Added a flag to use PNG instead of WebP for image fallbacks (much faster in debug mode)
• Simplified the ImageDataManager to use a single `FrameBuffer` type instead of varying `ProcessedImageData` types
• Fixed an issue where reuploading a display picture could result in it being deleted
• Fixed an issue where old display pictures wouldn't be removed when replaced
• Fixed a minor modal button layout issue
• Fixed a missing string variable issue
@mpretty-cyro
mpretty-cyro changed the base branch from master to dev October 15, 2025 00:34
@mpretty-cyro mpretty-cyro changed the title [WIP] New reupload logic for user display pics New reupload logic for user display pics Oct 15, 2025
@mpretty-cyro
mpretty-cyro marked this pull request as ready for review October 15, 2025 00:35
@mpretty-cyro
mpretty-cyro requested a review from RyanRory October 15, 2025 00:35
Comment thread Session/Media Viewing & Editing/CropScaleImageViewController.swift Outdated
• Added a dev action to be able to share a file by entering it's download url
• Added a minor recovery mechanism for lost/missing already-download files
• Dropped unused columns and a foreign key constraint from the Quote table
• Updated the MessageViewModel to no longer directly query Quote data (the associated MessageViewModel.QuotedInfo retrieves it)
• Fixed an issue where the current users profile may not update in all places
• Fixed an issue where sharing files was incorrectly trying to share them as URLs (most obvious when trying to share the log file)
• Fixed an issue where link preview images weren't being uploaded
• Fixed a buggy LinkPreviewView loading state
• Added more details to profile update logs (also added debug logs for updating other users profiles)
• Added a delay before killing the app after clearing data to give the libSession logger more time to shutdown (false crash reports)
• Removed some emoji encoding which is no longer needed
• Fixed a couple of cases where we were trying to access the libSession cache for new accounts before it had been created
• Fixed a bug where we could try to render a profile picture for the current user even if it hadn't been downloaded yet (resulting in nothing being rendered)
• Fixed a bug where restoring an account would clear the users display picture
• Fixed a bug where we wouldn't immediately download the users display picture after restoring an account
• Fixed a bug where video attachments weren't getting their metadata extracted correctly (preventing them from being sent correctly)
• Fixed a bug where some video formats might not be recognised as video
• Fixed a bug preventing emoji reactions in communities
• Fixed a bug where portrait images wouldn't crop correctly
• Fixed an issue where large display pic uploads weren't timing out correctly
• Fixed an issue where other platforms always want the "byteCount" to be the plaintext value
• Fixed an issue where the home and settings screens wouldn't update if they were open when the current users display picture finished downloading
• Fixed an issue where we wouldn't retry downloading a display picture because the profile data hadn't changed (even if the file hadn't been downloaded)
• Updated the re-upload job to run if the `shortenFileTTL` dev setting is turned on
• Rolled back the change to stop replicating the current user profile into the database (and the various attempted fixes that came as a result)
• Added env variable handling for "shortenFileTTL"
• Made some improvements to the libSession build script and error handling
• Fixed an issue where the reupload job would always extend to the max TTL regardless of the "shorten TTL" dev setting
• Fixed an issue where setting the profile name before setting the display pic could result in the old display pic being used (even when setting to the same value - bug in libSession needs to be fixed to handle this case)
• Fixed an issue where profile updates coming from libSession wouldn't be saved correctly in some cases
• Added some defensive coding to try to recover (re-download) the current users display picture if there is a discrepancy between the database and libSession states
• Fixed an issue where some screens wouldn't update when the current users display picture was updated on a different device
…reupload-changes

# Conflicts:
#	Session/Settings/DeveloperSettings/DeveloperSettingsViewModel.swift
#	SessionUtilitiesKit/General/Feature.swift
# Conflicts:
#	Session.xcodeproj/project.pbxproj
#	SessionUtilitiesKit/Crypto/CryptoError.swift
@mpretty-cyro
mpretty-cyro merged commit 52bd474 into session-foundation:dev Oct 28, 2025
1 check was pending
@mpretty-cyro
mpretty-cyro deleted the feature/profile-pic-reupload-changes branch October 28, 2025 05:05
This was referenced Oct 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request Jira This ticket is being tracked in Jira

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants