webxdc / store

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

Replace webxdc api integration (old, replaced with #215) #173

Closed Septias closed 1 year ago

Septias commented 1 year ago

This PR is replaced with #215

Uses the new API to replace the store. To test this I suggest using a local version of the deltachat-desktop which checks out the PR introducing the API. Otherwise, it will not work.

As to be expected, the desktop doesn't handle these replacements correctly atm. Instead of actually replacing the message a new message is shown in the chat which also shares the same time. Sending messages in the old message works just fine, but sending updates from the new ones produces this error:

DC: /home/sebastian/.cargo/git/checkouts/deltachat-core-rust-632648ad67f90089/3cfbac5/src/receive_imf.rs:288: receive_imf cannot update status: receive_status_update: status message has no parent..

close #79

link2xt commented 1 year ago

Sending messages in the old message works just fine, but sending updates from the old ones produces this error:

Should I read this as "sending messages in the new message works just fine"?

Septias commented 1 year ago

Sending messages in the old message works just fine, but sending updates from the old ones produces this error:

Should I read this as "sending messages in the new message works just fine"?

Otherway round. The massages added by dc-desktop a flawed.

link2xt commented 1 year ago

I have fixed the problem in the core PR, now .xdc is updated in Desktop but you need to reopen the chat and reopen the .xdc app.

The problem now is that updated .xdc shows new title etc., but keeps displaying "Outdated version". This is probably something for this repository to fix. And chat refreshing with maybe app autoreloading is for the UI side.

Septias commented 1 year ago

I guess the local storage of the app gets restored, making it impossible to notice something because of a vanished store... We can use the update received event to unlock the app again, but if the messages come in out of order, the replacement has not taken place yet when the frontend is unlocked again. Maybe some core-event/webxdcUpdate could be sent to make this deterministic?

link2xt commented 1 year ago

Could the version of the app be checked inside .xdc and compared to the "outdated" update to determine if it is still valid? If "outdated" updated says new version X is available, but we are already on a version Y >= X, we can ignore it.

Septias commented 1 year ago

True that can be done. It might be interesting to consider a dedicated event at some point though to improve the overall webxcd standard capabilities. But that is for now out of scope I believe.

Septias commented 1 year ago

It seems like the localStorage is not recovered in the new webxdc instance at the moment. Just to be clear - restoring local storage for webxdcs is the plan, right? @link2xt @Simon-Laux @hpk42

Simon-Laux commented 1 year ago

It seems like the localStorage is not recovered in the new webxdc instance at the moment. Just to be clear - restoring local storage for webxdcs is the plan, right? @link2xt @Simon-Laux @hpk42

If the account id and the message id of the webxdc are identical, then they both should have the same local storage. there is nothing "restored" it will just keep being there.

hpk42 commented 1 year ago

Yes, a replaced xdc attachment should still lead to re-using the localstorage state of the previous xdc app.

On Tue, Jul 18, 2023 at 02:12 -0700, Sebastian Klähn wrote:

It seems like the localStorage is not recovered in the new webxdc instance at the moment. Just to be clear - restoring local storage for webxdcs is the plan, right? @link2xt @Simon-Laux @hpk42

-- Reply to this email directly or view it on GitHub: https://github.com/webxdc/store/pull/173#issuecomment-1639842099 You are receiving this because you were mentioned.

Message ID: @.***>

Septias commented 1 year ago

@Simon-Laux Atm, the desktop still shows two messages (at least my deltachat-desktop-git arch package). What is the status to fix this?

Simon-Laux commented 1 year ago

at least my deltachat-desktop-git arch package

that does not use the git core, it uses the core that dc desktop master uses so still 1.107 at the time

What is the status to fix this?

so basically you are using an old version so there is nothing to "fix". when you use master core in a local desktop checkout then you can create an issue in the desktop repo if there still are bugs.

link2xt commented 1 year ago

The documentation for using the latest core on desktop is at https://github.com/deltachat/deltachat-desktop/blob/master/docs/UPDATE_CORE.md by the way.

link2xt commented 1 year ago

I have squashed all commits into one and rebased this PR forward a bit.

Will make a separate PR to update the core now.