refactor(channel): remove unused pushName field#2460
Open
vduggen wants to merge 2 commits intoEvolutionAPI:developfrom
Open
refactor(channel): remove unused pushName field#2460vduggen wants to merge 2 commits intoEvolutionAPI:developfrom
vduggen wants to merge 2 commits intoEvolutionAPI:developfrom
Conversation
Contributor
Reviewer's guide (collapsed on small PRs)Reviewer's GuideRemoves a redundant selection of the pushName field from a channel query so that the value computed earlier in the query is no longer incorrectly overridden with Chat.name, preventing null/incorrect pushName results. File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📋 Description
This PR updates the chat listing query to ensure that the
pushNamealways reflects the contact’s name, not the name from the last message sender.Previously, in the PostgreSQL
fetchChatsquery, thepushNamefor non-group chats was calculated usingCOALESCE("Contact"."pushName", "Message"."pushName"). This could lead to incorrect results: when the last message was sent by someone else (e.g., in a multi-participant context), thepushNamewould show the sender’s name instead of the contact’s name. The query has been updated so that, for non-group chats,pushNamenow uses only"Contact"."pushName", preventing it from being overridden by"Message"."pushName"and ensuring consistent, contact-based naming.🔗 Related Issue
Closes #(issue_number)
🧪 Type of Change
🧪 Testing
Testing details:
pushName, but instead correctly show the contact’spushName.Contact.pushNamekeep the same visible name.📸 Screenshots (if applicable)
✅ Checklist
📝 Additional Notes
pushNamebehavior with the expectation that it always represents the contact’s name in chat lists, avoiding confusion when the last message is sent by someone else.