webxdc / store

XDC store, migrated to codeberg
https://codeberg.org/webxdc/store
5 stars 0 forks source link

feat: Bot-xdc upgrading #83

Closed Septias closed 1 year ago

Septias commented 1 year ago

Adds upgrading for the store frontend xdcs (the store.xdc, submit.xdc etc.) This provides the starting point for #79

Idea:

  1. As soon as the bot starts it will load all needed webxdcs from bot-data. (With RUST_LOG=info set it will show the loaded versions in the console).
  2. On request, the bot will serve these versions. As soon as you edit the store.xdc's manifest.toml in bot-data, the bot will load the newer version upon startup.
  3. Requests from an older frontend will trigger a response saying an update is needed.
  4. On receival, the frontend will blur out and show a button to update. When this is pressed a request is sent to the bot.
  5. The bot will then post the newest version to the 1:1 chat.

This is also shown in a python test

github-actions[bot] commented 1 year ago

Download the preview at https://download.delta.chat/store/preview/appstore-bot-83.tar.gz

github-actions[bot] commented 1 year ago

Download the preview at https://download.delta.chat/store/preview/appstore-bot-83.tar.gz

github-actions[bot] commented 1 year ago

Download the preview at https://download.delta.chat/store/preview/appstore-bot-83.tar.gz

github-actions[bot] commented 1 year ago

Download the preview at https://download.delta.chat/store/preview/appstore-bot-83.tar.gz

github-actions[bot] commented 1 year ago

Download the preview at https://download.delta.chat/store/preview/appstore-bot-83.tar.gz

Septias commented 1 year ago

true, will remove it later

github-actions[bot] commented 1 year ago

Download the preview at https://download.delta.chat/store/preview/appstore-bot-83.tar.gz

github-actions[bot] commented 1 year ago

Download the preview at https://download.delta.chat/store/preview/xdcstore-83.tar.gz

github-actions[bot] commented 1 year ago

Download the preview at https://download.delta.chat/store/preview/xdcstore-83.tar.gz

hpk42 commented 1 year ago

so after a bit of fiddling (the initialization sequence it not too nice but that's off-topic) i was able to run the bot, got the store.xdc and opened it, downloaded an app, then

but then updating the app-index in the still running store.xdc did not cause a warning, only when i tried to download a new app the attached screen appeared, but no new store.xdc arrived in my store-chat.
Screenshot from 2023-06-27 19-11-18

sebi, please provide the precise steps how this PR can be manually tested (i spent ~45 minutes now and am still not sure if i did things right) especially if there are not automated tests.

Septias commented 1 year ago

Bot test steps and test result is as implemented. We at some point agreed to do Webxdc updating lazily. For testing, you could also edit the manifest.romt of the bundled store.xdc in the bot-data directory

Septias commented 1 year ago

Testing is hard to do because there is no easy to implement e2e testing for bot and DC. I can add a python test later though

hpk42 commented 1 year ago

could you simply clarify how a manual test of the code can be done? (i am aware that having an automated test for this PR is not easy or feasible currently) -- What do you mean with updating "lazily"? It really helps if you are a bit more explicit about these things because otherwise i need to spend a lot of time trying to find out myself the details, probably like 5x more than it would take you to just be more explicit.

Septias commented 1 year ago

@hpk I added the download confirmation we talked about earlier and for me, the frontend is disabled even when clicking update.

adbenitez commented 1 year ago

I tested it, this PR came a bit early before getting the in-place core api, so I am not sure it is good idea to invest too much efforts in making a UI that works well for the current situation, the upcoming API workflow will be like:

adbenitez commented 1 year ago

recomendation: show the store version somewhere inside the app