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

[WASM] IndexDB dependency breaks app if run under latest Tor alpha: [IndexedDB not available: A mutation operation was attempted on a database that did not allow mutations.] #34102

Closed
RobertoMalatesta opened this issue Dec 4, 2019 · 10 comments

Comments

@RobertoMalatesta
Copy link

Godot version:
3.1.2 / 3.2b1 / git-pulled latest as well

OS/device including version:
app built as web wasm / testing on Tor 9.5a2 desktop / (with godot on ubuntu server 18.04)

Issue description:

Steps to reproduce:

  • export any application as html project
  • publish it on any site
  • access it with Tor Browser 9.5a2 (first one that has wasm and webgl enabled support)
  • the app will crash with the error:
    IndexedDB not available: A mutation operation was attempted on a database that did not allow mutations.

(The app will work with Brave Browser Tor impl. since Brave is more relaxed).

Minimal reproduction project:
Here: If it works it shows a button

It takes some time to load. More than the usual abysmal since is a debug build.

For the impatient here there are two

Screenshots

On Tor alpha 2 :
image

On Brave + Tor network:
image

Volunteering and other considerations

IndexedDB writes on disk, so the Tor Project has severely limited it.
Besides, I don't see a real reason to use it as mandatory in a web-based application.
I know the Godot devs are overwhelmed with issues to fix and features to implement so,
time permitting, I'd like to give a hand.

Just a start: is there any document with the exports modules rationale or some pointers to where in the code export modules are implemented?

Thank you for the time and the fantastic work!

Roberto

@akien-mga
Copy link
Member

akien-mga commented Dec 4, 2019

That's a relatively niche use case, and I'd tend to say that it works as intended, huge JS games in the browser is definitely something that privacy-minded Tor users should avoid.

Still, it should be possible to have things work without filesystem access indeed, so IDBFS could be made opt-out. Relevant code is here:
https://github.com/godotengine/godot/blob/master/platform/javascript/javascript_main.cpp

As we can see IDBFS support is already optional, but the way Tor blocks it is probably not handled gracefully.

@RobertoMalatesta
Copy link
Author

On a quick inspection of index.js:
IDBFS is tested against undefined but i seem to recall Tor supporting some sanitized form of it.
image

(Tor console:)
image

Aesthetically it seems the same of Firefox 73:
image

ASAP I'll try bruteforcing a NULL return instead of the check to see if it proceeds.
One thing to consider is that Tor just introduced wasm defaulted yes in the latest alpha.
Then can revert their mind in the release version, or change the logic altogether.
It happened for asm.js (*) some time ago: it was in then out then in again.

(*) Even more nicher: has anyone compiled godot for asm.js ? A couple of months ago I succeeded in compiling and running the entire engine for webassembly with some minimal effort so an asm.js could be in theory feasible (taking out maybe some pieces).

-- R

@Calinou
Copy link
Member

Calinou commented Dec 4, 2019

(*) Even more nicher: has anyone compiled godot for asm.js ? A couple of months ago I succeeded in compiling and running the entire engine for webassembly with some minimal effort so an asm.js could be in theory feasible (taking out maybe some pieces).

This was supported in Godot 2.x, but has been removed in Godot 3.0 thanks to WebAssembly support becoming widespread enough. That said, someone made a pull request to reintegrate asm.js support due to Safari iOS' WebAssembly support being problematic.

@RobertoMalatesta
Copy link
Author

Hi @Calinou ,

This was supported in Godot 2.x

I remember that. Somewhere I have a 2d test project on it.

Safari iOS' WebAssembly support being problematic.

Agreed. Safari is the problematic child of the WWW, but even more (and remaining in the rotten corpses league) I was thinking about IE11.
IE11 will be supported until 2025 at least, and it's still in use inside banking institutions and industries.
The point is that Godot is such a wonderful tool that some of us not involved in game development see it as a fantastic tool for almost every type of application.

As a side note asm.js could be an escape plan for the day when again some serious sec flaw will be discovered in wasm.

--R

@Calinou
Copy link
Member

Calinou commented Dec 4, 2019

The point is that Godot is such a wonderful tool that some of us not involved in game development see it as a fantastic tool for almost every type of application.

I think there are tools more suited than Godot to make Web applications. I wouldn't see it as a priority 🙂

See also A Business Case for Dropping Internet Explorer.

@RobertoMalatesta
Copy link
Author

@Calinou

I wouldn't see it as a priority

Indeed it's not.

short somehow OT:

See also A Business Case for Dropping Internet Explorer.

Fun! It seems taken straight from the Rant Department!
Even funnier:
The big winner was, shockingly...

Before we get rid of IE11 in 2025 (maybe), two other major browsers will drop stone dead, or will be emasculated like Edge.

--R

@akien-mga
Copy link
Member

@Faless I guess this is related to #39495 and might have been fixed similarly?

@Faless
Copy link
Collaborator

Faless commented Jun 16, 2020

@akien-mga partially, Tor browser still doesn't work since it does not support AudioContext.
I don't really think we can support it given all the limitation it has (and will have). WebAssembly is not even available unless you use the standard (lowest) security option (which is not the default).

@Calinou
Copy link
Member

Calinou commented Jun 16, 2020

@Faless We should still attempt to fail gracefully in this case (if possible). Other than that, I don't think we can support HTML5 exports in Tor Browser either.

@Faless
Copy link
Collaborator

Faless commented Jul 2, 2020

Fixed via #39495 and #40018 .

@Faless Faless closed this as completed Jul 2, 2020
@akien-mga akien-mga added this to the 4.0 milestone Jul 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants