fix_: saving profile image changes ens display name to non-ens #5156
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
When a user updates the preferred name, we should just ignore if the name is an ENS name, because the ENS name is set only in the ENS popup. But this also means that if a user set the profile name to an ENS name, this change will also be ignored.
Detailed description/Analysis
I think I understand the problem. Let me try to summarize it.
Previously, we faced issue where the user could change the displayed name to
x.y.z
, and this prevented other clients from displaying messages due to the validation on the display name.However, ENS names have the format
x.y.z
, for example :kounkou.stateofus.eth
, and in the current ticket, we fall into a dilemma where we have 2 cases :1- If we have a display name not being in the
x.y.z
format and we want to change to thex.y.z
format, the validation will fail.2- If we had 2 ENS names to choose from, and we decided to move from one to another ENS name, then the validation will fail for the same.
Case 2 raises the question :
This is because upon updating the ENS name, the actual call to update settings is https://github.com/status-im/status-desktop/blob/master/src/app_service/service/settings/service.nim#L148
Solution Proposal
When a user update the preferred name, we should just ignore if the name is an ENS name, because the ENS name is set only in the ENS popup. But this also means that if a user set the profile name to an ENS name, this change will also be ignored.
fixes status-im/status-desktop#14048