-
Notifications
You must be signed in to change notification settings - Fork 78
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
Fix(@message) Album of images disappears from reply after reloading t… #12806
Conversation
Jenkins BuildsClick to see older builds (5)
|
I am missing some nim tests, Adding them. |
c263054
to
74ae23e
Compare
|
||
|
||
proc setQuotedMessageImages(self: Module, messages: seq[MessageDto], items: var seq[Item], albumIdToImagesMap: Table[string, seq[string]]) = | ||
for message in messages: |
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.
This look quite suspicious to me that we have ffor message in messages
here while setQuotedMessageImages
is already called in the same message loop. You sure everything's ok here? 🙂
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.
Good eye. We can probably move setQuotedMessageImages
out of the loop in newMessagesLoaded
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.
Let me have a second look on it. Good catch. Updating this.
src/app/modules/main/chat_section/chat_content/messages/module.nim
Outdated
Show resolved
Hide resolved
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.
Nice work!
I left a couple of suggestions and also, sadly, we'll need some more work on it in another issue to move it to status-go, since just using Nim is not good enough, since Nim doesn't have all the data.
|
||
|
||
proc setQuotedMessageImages(self: Module, messages: seq[MessageDto], items: var seq[Item], albumIdToImagesMap: Table[string, seq[string]]) = | ||
for message in messages: |
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.
Good eye. We can probably move setQuotedMessageImages
out of the loop in newMessagesLoaded
…he application Fixes #10986 This PR contains 2 changes : 1- Adding of properties for the quotedMessage 2- Update of the view with the properties with Qml binding
74ae23e
to
9a59d35
Compare
I have added a ticket : #12821 which I believe would solve more consistently the missing image in reply problem exposed here. From all the above, I believe it might not make more sense to dive deep further into the current implementation/PR. Please let me know if any thoughts. |
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.
Looks good. Like discussed, this will need some work on the status-go side to make sure it works in all cases, but for now, this PR still helps mitigate the issue so I'm fine with merging it.
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.
Nice job! 👍
Fix(@message) Album of images disappears from reply after reloading the application
Fixes #10986
This PR contains 2 changes :
1- Adding of properties for the quotedMessage
2- Update of the view with the properties with Qml binding
Design decisions :
The reason why the before reload everything works perfectly is because inside MessageView.qml
status-desktop/ui/imports/shared/views/chat/MessageView.qml
Line 669 in 7830310
On
onResponseMessageChanged
signal, we call themessageStore.getMessageByIdAsJson(responseToMessageWithId)
to obtain the images of the quotedMessage.But the model is not made aware of this change at any time. Therefore, when reloading the application, the message doesn't contain the necessary quoted Images to be displayed.
However, the quotedMessage text already exists in the model.
In this PR they were 3 ways to accomplish the goal of fixing the disappearing of images after reloading the application :
[preferred]
[performance Impactful change as more payload to process]
[slow and unreliable method]
What does the PR do
The PR adds 2 Qml properties and bind them to the View. The 2 properties are the
quotedMessageAlbumMessageImages
and thequotedMessageAlbumImagesCount
that are necessary to display the quoted images (thumbnails) in replies along with how many of the images need to be displayed.Affected areas
Chat screen is affected. There are only additions to the code.
Screenshot of functionality (including design for comparison)
Cheers!