Skip to content
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

feat: Add bot contact to every account #6096

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Septias
Copy link
Contributor

@Septias Septias commented Oct 23, 2024

This PR adds a database migration that creates the xstore contact for every account. New accounts are affected as well as already existing accounts.

closes #5855

inc_and_check(&mut migration_version, 124)?;
if dbversion < migration_version {
sql.execute_migration(
"INSERT INTO contacts (name, addr, origin, authname, is_bot) VALUES ('xstore', '[email protected]', 67108864, '', true);",
Copy link
Collaborator

Choose a reason for hiding this comment

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

What does origin 6710886 mean?

@link2xt
Copy link
Collaborator

link2xt commented Oct 23, 2024

Also the tests fail and I'm not sure how useful is the contact without a key.

One idea to fix this was to have an API to import vCard and mark imported contacts as verified, then import this from the UI side rather than with migration so ArcaneChat can import other bots as well and we don't hardcode xstore into the core.

@Simon-Laux
Copy link
Member

I thought the latest idea was to let the bot die because it was buggy or sth. and integrate a "store" directly into the attachment menu. Did something change?

@adbenitez
Copy link
Member

adbenitez commented Oct 23, 2024

I thought the latest idea was to let the bot die because it was buggy or sth. and integrate a "store" directly into the attachment menu. Did something change?

even if we go for something else, I would not say that just because something "is buggy" the better solution is to let it die and build something similar from scratch and hope the new iteration would have no bugs!?
the main reason to go for an integrated store without bot is because:

  • it is faster,
  • doesn't leak your email address and crypto identity and metadata of apps you downloaded to a 3rd party
  • better UX without the complexities of a bot + webxdc in a chat

that said, the UI that the bot has is even more ready than the one in the web version we have and it just needs some improvements, if making the whole thing from scratch would be simpler and produce a more simple and maintainable code base I don't know, but the best would be if any UI that we decide to use could work both as a web site and as a webxdc, that could be used by the existing bot and by Delta Chat clients as integrations for the clients that don't want to just download the json metadata and implement native UI for the app picker, similar to how the bots index is a bot and a website at the same time with the same code

more back to present time: the question is what is easier? just add the store bot so users can access mini-apps in the mean time or add the new picker in a few hours?? the picker would need some time, and in the meantime it is good that the users can use the xstore bot at least

@link2xt
Copy link
Collaborator

link2xt commented Oct 23, 2024

xstore works fine and gets updates automatically, and accessing it via email without direct HTTP requests is useful. We don't even have the store in the attachment menu now.

But anyway, the original issue is about adding "invite link" because it should result into sending the message back immediately when you scan the QR code. Having a contact "xstore" in the contact list without any explanation that has empty chat does not help, users will likely not write to such bot first.

@Simon-Laux
Copy link
Member

Simon-Laux commented Oct 23, 2024

I did not say that this was my opinion, just what I heard from holger. my question was if consensus changed / what the current consensus is.

now back to the topic -> don't call it x-store, people will not understand that name, it's name should be more descriptive and less technical.

But anyway, the original issue is about adding "invite link" because it should result into sending the message back immediately when you scan the QR code.

device message or fake contact list item in the UI? or sth. else?

@adbenitez
Copy link
Member

xstore works fine and gets updates automatically, and accessing it via email without direct HTTP requests is useful. We don't even have the store in the attachment menu now.

exactly keeping updates would be then needed to be done by the client pinging some random website to fetch metadata, the website could be blocked and if we use github link that would count as anti-feature depending in non-free network

now back to the topic -> don't call it x-store, people will not understand that name, it's name should be more descriptive and less technical.

+1 I really don't like the xstore name, also the bot doesn't even has a nice display name

@adbenitez
Copy link
Member

But anyway, the original issue is about adding "invite link" because it should result into sending the message back immediately when you scan the QR code. Having a contact "xstore" in the contact list without any explanation that has empty chat does not help, users will likely not write to such bot first.

I think it still helps to have the contact added (with avatar and all) what about this solution that would not require any UI changes:
when the user clicks in the contact in the contact list, and the UI calls createChat() for this contact because there is no chat yet, core then will cause a secure join link scan for this contact and create the chat that way instead the normal chat creation

@Simon-Laux
Copy link
Member

Simon-Laux commented Oct 23, 2024

can't we just hardcode the initial current public key / peerstate for the x store bot?
If you send a message to wrong key it still goes out with chatmail and you get the unknown key response and the new key.

@iequidoo
Copy link
Collaborator

One idea to fix this was to have an API to import vCard and mark imported contacts as verified, then import this from the UI side rather than with migration so ArcaneChat can import other bots as well and we don't hardcode xstore into the core.

import_vcard() is already here, the only thing is that it doesn't mark the contact as verified, but we can add a flag for this. Then, maybe don't hardcode too much, but just add a device message with a bot vCard attachment? This could be done upon an initial setup and once for already existing setups as well, and also when smth new happens with the official webxdc store.

@r10s
Copy link
Member

r10s commented Oct 23, 2024

but just add a device message with a bot vCard attachment?

after initial installation, the device chat is for importing onboarding information eg. how to get in contact with others. we do not want to clutter this chat with too many information - this is also the reason, we do not add a "changes" device message there after initial installation.

therefore, an entry in the contact list is much less cluttering ui and distracting; it also feels quite natural, and it is also okay, if the user does not discover it in the first minutes. let's better stay with that idea 1

Footnotes

  1. under the hood a vcard can be still used - eg. have one in the assets folder and a function that adds that to the contact list (not: create a chat), including key, avatar, bio. but thats only technical details, maybe other ways are easier.

@Septias
Copy link
Contributor Author

Septias commented Oct 24, 2024

I think giving the contact a proper display name like "Deltachat Apps" or something more descriptive together with a chat that has the xstore icon and a status explaining the contact should make the use already quite obvious for an unknowing user.
Other than that I quite like @iequidoo's Idea with some device message and vcard, because that also helps users discover the app service.

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.

Add invite-link to xstore bot to the menu or contact list
6 participants