-
Notifications
You must be signed in to change notification settings - Fork 119
IPFS Profile Photos #3048
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
IPFS Profile Photos #3048
Conversation
Quiet will still load the old base64-inlined profile photos, but new photos will be attached to profiles with an IPFS CID.
3a10047 to
3befa86
Compare
| try { | ||
| yield all([takeEvery(usersActions.saveUserProfile.type, saveUserProfileSaga, socket)]) | ||
| yield all([ | ||
| takeEvery(usersActions.saveUserProfile.type, saveUserProfileSaga, socket), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Claude insists that this creates nested watchers:
This creates nested watchers - every updateUserProfiles dispatch spawns a new takeEvery watcher. Should either be fork(downloadProfilePhotosSaga) once, or the inner saga should not use takeEvery.
Is this a valid issue or a false positive?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ahhhh, after looking a bit into how this works, I think this is in fact an issue, which will cause new permanent child tasks to keep spawning with every run. Nice catch.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I pushed a little update to the e2e test that fixed the failure. LGTM otherwise
|
You're a hero @adrastaea |
|
One note, please update the changelog before pushing |
Migration
This update deprecates the previous profile photo method of setting a base64-encoded image URI within the profile metadata, in favor of using the IPFS attachment upload pipeline.
Old profile photos are still displayed as expected, but when a new profile photo is set, it will only use the new IPFS flow, so older clients will not see a photo. I can change this to do both at the same time, but that feels like it defeats the purpose a bit, and we're at the turn of a new major version here as well.
Approach
This creates a new "virtual channel" for attachment photos so that we can reuse as much of the same image attachment processing pipeline as possible.
Some things obviously couldn't be handled the same, though, so you'll notice some conditional handling of profile photo attachments that stray from the typical assumption that an attachment is associated with a message in a viewable chat room.
Fixes #2926.