Skip to content
This repository has been archived by the owner on Jan 31, 2024. It is now read-only.

spec: web server behavior (index.html, /, etc) #61

Closed
WofWca opened this issue Jul 8, 2023 · 1 comment
Closed

spec: web server behavior (index.html, /, etc) #61

WofWca opened this issue Jul 8, 2023 · 1 comment
Labels
api-change-move-to-forum this issue proposes an api change which belong in the forum, so it should be summarised an put there

Comments

@WofWca
Copy link
Contributor

WofWca commented Jul 8, 2023

This came up after webxdc/store#158 (comment). Basically the behavior of apps that use things like React/Vue/Solid routers is unreliable (might be broken) because it's not clearly defined how the webxdc web server works.

/ -> /index.html

The current webxdc implementations (at least Desktop and Android) open the app in such a way that the initial URL is /index.html, not /. This is because of <iframe src="/index.html":

https://github.com/deltachat/deltachat-android/blob/3becdf52ecc2623b6d1ad5fd2195a2ee674a2c76/res/raw/webxdc_wrapper.html#L131

https://github.com/deltachat/deltachat-desktop/blob/750721ca5b8e4e9c1c376c95cec470eefefd474c/static/webxdc-preload.js#L108

Replacing src = "index.html" with src = "/" should work, as long as the server would respond with the contents of index.html to such a request (currently Delta Chat desktop responds with an error). Most web servers do, like Python's http.

I believe this started being the case after the WebRTC patches.

non-existent -> /index.html

Here are Vue Router docs about how the server needs to be configured for the HTML5 history mode to work properly. It says

If the URL doesn't match any static assets, it should serve the same index.html page that your app lives in.

Which is a more debatable thing than just the "/" -> "/index.html", but it's also somewhat less common to encounter a situation where it is useful, at least as of now, because currently you can't open a webxdc app with a different initial URL. But you can reload a webxdc app, e.g. in Delta Chat desktop, with Ctrl+R (although currently it would just cause it to get closed because of WebRTC mitigation stuff), which would result in a 404 (or is it a network error instead? should we specify this as well?).

@Simon-Laux Simon-Laux added the api-change-move-to-forum this issue proposes an api change which belong in the forum, so it should be summarised an put there label Sep 21, 2023
@WofWca
Copy link
Contributor Author

WofWca commented Sep 22, 2023

@WofWca WofWca closed this as not planned Won't fix, can't repro, duplicate, stale Sep 22, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
api-change-move-to-forum this issue proposes an api change which belong in the forum, so it should be summarised an put there
Projects
None yet
Development

No branches or pull requests

2 participants