+
Skip to content

Conversation

iequidoo
Copy link
Collaborator

@iequidoo iequidoo commented Oct 10, 2025

See commit messages.
Replacement for #7289. Tested manually in Desktop.
Close #7296

@r10s
Copy link
Contributor

r10s commented Oct 10, 2025

as key import is mentioned in #7289 as a reason to no wait for key: importing own key is no longer supported. so we can probably wait until key is generated, that would not add additional compleyity and states

apart from that, where is self-color acutually used for self? on avatar selection? there maybe show an icon similar to android/ios, nudging ppl to set an avatar

@link2xt
Copy link
Collaborator

link2xt commented Oct 10, 2025

Will add tests if the approach is agreed.

It's difficult to understand what the issue is, better open an issue with the description of a bug first.

There is some description in #7289, but that is also a PR.

@Simon-Laux
Copy link
Contributor

Simon-Laux commented Oct 10, 2025

apart from that, where is self-color acutually used for self? on avatar selection? there maybe show an icon similar to android/ios, nudging ppl to set an avatar

in desktop it is used in account selector and settings, which is also the case in iOS.

For the avatar selection I tend to agree that it may make sense to nudge people into setting an avatar, but desktop already does that during account creation, just not when you open the edit dialog for the avatar/profile afterwards. so not sure if it is worth changing there.
image image

For the account selector it is important to still have a colored icon IMO, to distinguish the accounts from each other.


about the issue:
I would just emit existing "AccountsChanged" when color changes (that should reload the accounts list),
I doubt that we need a new event for this, which would also need a corresponding desktop pr to listen for a new event.

@link2xt
Copy link
Collaborator

link2xt commented Oct 11, 2025

I still don't know what the issue is. On desktop when I create a new profile, in the profile selector on the left the color is grey, so no incorrect color is seen.

I would just emit existing "AccountsChanged" when color changes (that should reload the accounts list),

I also agree that whatever the problem is, UI developers should not need to care about the keys and know that SelfKeyAvailable means the color is changed. What matters for UI is whether the color is available or not, regardless of whether it depends on the key or address or anything else.

@iequidoo
Copy link
Collaborator Author

iequidoo commented Oct 11, 2025

as key import is mentioned in #7289 as a reason to no wait for key: importing own key is no longer supported. so we can probably wait until key is generated, that would not add additional compleyity and states

Key import isn't supported explicitly in UIs, but it's still supported via sending an Autocrypt Setup Message, there are Rust and Python tests on that. Firstly i forgot about that and tried to fix the bug without using a temporary gray color. Anyway, i think the fix here isn't that complex and also we can use AccountsChanged as @Simon-Laux suggested, so it's not necessary to drop ASM support because of such minor bugs.
...
AccountsItemChanged fits better i think.

@Simon-Laux
Copy link
Contributor

AccountsItemChanged fits better i think.

true

@iequidoo iequidoo force-pushed the iequidoo/event-SelfKeyAvailable branch 2 times, most recently from 1da8e0f to b414119 Compare October 11, 2025 19:13
@iequidoo iequidoo changed the title api: Add SelfKeyAvailable event (own keypair generated or imported) fix: Emit AccountsItemChanged when own key is generated/imported, use gray self-color until that (#7296) Oct 11, 2025
@iequidoo
Copy link
Collaborator Author

I've checked, with AccountsItemChanged the fix just works for Desktop, no changes are needed on the UI side

@r10s
Copy link
Contributor

r10s commented Oct 11, 2025

but it's still supported via sending an Autocrypt Setup Message

sending: yes. but which deltachat can import them? this should be regarded as a bug.

so it's not necessary to drop ASM support because of such minor bugs.

we really do not want to allow importing random keys via ASM or elsewhere - for security reasons, to make some concrete assumptions about security. avg user will never try that anyways, and we do no longer want to allow that.

so, ASM and import-keys that is never used should not rule other decisions in general

but yeah, this PR looks simple enough, and if it fixes an issue at hand, it seems fine

@iequidoo
Copy link
Collaborator Author

iequidoo commented Oct 12, 2025

Ok, entering the ASM code is dropped from UIs, but Core still supports that, so even if that should be dropped (but i don't think so -- for security audits we can say that this Core feature is out of scope), this should be done separately and for now the bug can't be fixed by generating own keypair during configuration because this breaks Rust and Python tests.
...
Overall i don't like the idea that Core should provide some "asymmetric" functionality like exporting but not importing keys and sending but not processing received ASMs. It would be even difficult to test.

… gray self-color until that (#7296)

Emitting an `AccountsItemChanged` event is needed for UIs to know when `Contact::get_color()` starts
returning the true color for `SELF`. Before, an address-based color was returned for a new account
which was changing to a fingerprint-based color e.g. on app restart. Now the self-color is our
favorite gray until own keypair is generated or imported e.g. via ASM.
@iequidoo iequidoo force-pushed the iequidoo/event-SelfKeyAvailable branch from b414119 to 4317354 Compare October 12, 2025 04:35
@iequidoo iequidoo requested a review from Simon-Laux October 12, 2025 04:37
Copy link
Contributor

@Simon-Laux Simon-Laux left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, but maybe wait for someone else to also approve

@iequidoo iequidoo merged commit 0e47e89 into main Oct 12, 2025
29 checks passed
@iequidoo iequidoo deleted the iequidoo/event-SelfKeyAvailable branch October 12, 2025 17:17
@iequidoo
Copy link
Collaborator Author

Decided to merge, the fix is simple enough

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Address-based account color is used until own key is created/imported

4 participants

点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载