Improves stability by closing the document
only after uploading has finished.
Change-Id: I20927a5d009998d9d7a25c3309fef02a45077c70
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
This fixes a corner-case where we modify and
save during uploading, which means that the
next save will not have any modifications,
and we will not merge the attributes until
we get new modifications.
Change-Id: I621e26e04ea3e0d04a9a3d535ff2cfc607d56fef
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
We now capture the flag that controls the
IsExitSave header directly via the result
of IsUnloading(). This makes passing it
via function parameters obsolete.
Change-Id: Idb4df4f96d66b4a9f92ff9a570f48be895e623be
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
You now must pass --with-wasm-additional-files=<path> where path
contains a file called sample.docx.
Signed-off-by: Tor Lillqvist <tml@collabora.com>
Change-Id: I21e62feb6282833a5d60b31db26328eda63cdaea
Now I hope things are initialised in the right order and the plumbing
gets set up so that messages are passed as expected. It seems to work
most of the time.
Main changes are:
- The online WASM executable is built using the -s MODULARIZE -s
EXPORT_NAME=createOnlineModule options. This means that the WASM
runtime is not automatically initialized and the main() function
is not automatically started. Only when the createOnlineModule()
function is called is that done. Calling exported C/C++ functions
is a little bit more complicated.
- Code to actually Base64-encode strings to be executed as
JavaScript when expected is now present in wasmapp.cpp. (After
being passed through the Base64ToArrayBuffer function on the JS
side.) Whether this is actually necessary is not fully clear, but
to keep the code similar to that in the GTK, iOS, and Android
apps, this is kept as such for now. It would probably work fine to
just directly create the ArrayBuffer in the C++ (using the EM_ASM
magic).
- The COOLWSD::run() function is now run in a separate thread so
that main() can return.
- The FakeWebSocket's onopen() function is now called from
innerMain(), where the HULLO message is sent. It remains a bit
unclear if this really is the ideal place.
In the mobile apps the HULLO message is sent and the onopen()
function is called in the window.socket.onopen() function in
global.js.
But note that despite that the WASM app and the mobile apps are
largely quite similarly constructed and the FakeSocket and
FakeWebSocket plumbing is the same, there is an important
difference. In a mobile app the C++ code is what runs first, and
that then loads the HTML page into WebKit, in which the JS
runs. In the WASM app it is the other way around. The web page is
naturaly the one that is loaded and the JS code then starts
running the C++ code as WASM.
Finally, note that the whole concept that there is a separate "WASM
app" is temporary.
What we eventually want to achieve is that the COOL webpage upon
loading will connect a COOL server. As it does currently. The COOL
server runs the online and core C++ code to load a document, and
renders document tiles and sends those to the client JS code to
dispay.
The new thing will be that, if enabled, in addition to the HTML and JS
resources, the client will also download the WASM code and data
resources. Also, the document and updates to it will be downloaded
while being edited so that a copy can be kept in client memory. But
the WASM code and the downloaded document will remain unused most of
the time. Only if the connection to the COOL server breaks will the JS
start running the WASM code and the JS will talk to online code
running locally as WASM instead of to a COOL server. Obviously there
are still lots of things hanging in the air here regarding how exactly
this will work.
Signed-off-by: Tor Lillqvist <tml@collabora.com>
Change-Id: Ib1786a0b485d51797b0f2302d4296aa1ff9df5c1
After my shortly upcoming commits the document gets loaded and its
tiles displayed by the code that normally does that. No need to
separately verify that loading a document works.
Signed-off-by: Tor Lillqvist <tml@collabora.com>
Change-Id: Id5883f36644b5e9b79c3f80ea2131e9f35823b2f
Pass the absolute pathname to directory that contains a tree of additional
files you want to be available in the WASM in-memory file system. Relevant
only if you build for WASM with Emscripten, i.e. with
--host=wasm32-local-emscripten.
(This is not usable without my still uncommitted / unpushed WIP
hacking.)
Signed-off-by: Tor Lillqvist <tml@collabora.com>
Change-Id: I97a4651bed89bf35c50b009e04ddaa3e03aa8006
(Note that the existence of a window.ThisIsTheEmscriptenApp property
is also a temporary hack; the eventual goal is for a one same Online
webpage to be able to switch automatically from server-based to
WASM-based and back based on connectivity to the server.)
Signed-off-by: Tor Lillqvist <tml@collabora.com>
Change-Id: Ia5e3f4008eaaf1543c08482418635dca0d3983e5
Signed-off-by: Tor Lillqvist <tml@collabora.com>
When we click empty part of navbar or notebookbar bar, focus
should be on sheet. There are some wide containers
(eg document title) and they looking like empty area. Clicking
there makes lost the focus. Here we add aditional conditions
to check if user cliked that empty looking areas.
Without this patch, focus is on browser itself and CTRL+S
saves the HTML instead of current document.
Signed-off-by: Gülşah Köse <gulsah.kose@collabora.com>
Change-Id: I3a94c2d66dc093475e6674543b36b2c6905df2c0
When uploading fails, we shouldn't
rely on another save or close to
happen, we should retry as soon as
possible (right after the
min_time_between_uploads_ms elapses).
Change-Id: Ieabe7656583cf391f637986f5403acc87bdc913f
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
Forced uploading is used to overwrite the
file in storage. This is useful when there
is a conflict. Only the user can decide to
do (or not do) that. As such, no auto-save
or any other case should force an upload.
The issue is that we can clobber a conflicted
version in storage by accident. Forced upload
was used for always_exit_on_save=true setting,
which wasn't really needed as the feature isn't
to forcefully upload, rather to just save and
upload as necessary.
Change-Id: Ie46f38f76392493fe8f8112f05953899963da99b
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
We never enter the condition in question
if !_documentChangedInStorage, so the
code removed could never execute.
Change-Id: Ia183b63d7a13f6316eb5f24636997b6e6e417a97
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
This is necessary for multi-test scenarios
where the flag might be changed between tests.
Change-Id: I2fd9c21bc7ccdf2c9941ca3a959b578ec226facc
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
No reason to consider the 'exit' command
unexpected or a cause for error, so the
process exit code needs not be anything
but 0.
Change-Id: I352f706c6f174b66e9a4814fc35bb95b1a3bf3d6
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
There was a race between the closedocument
command and the save command that caused
occassional random failures.
Change-Id: I9e0e71545bab586826273fdb6e160b624be91dbe
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
Another failure-to-upload test that best
belongs to the UnitWOPIFailUpload suite.
Change-Id: I48f34413337f34a959a38402409e7321203dff35
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
There is an element displayed as a column before ratio
and we then hide it which is fine but, when ratio label
becomes to lengthly (Seitenverhältnis beibehalten) it then
gets cropped due to lack of space.
- Make it span across columns
- Do not align to the end
- Remove left margin from checkbox
Signed-off-by: Pedro Pinto Silva <pedro.silva@collabora.com>
Change-Id: I02ec7a608c0b330a52fa70db3b453fe04fefa805
Apparently handle_cool_message() gets called from a web worker thread
and then using emscripten_run_script() in wasmapp.cpp to run a JS
snippet that refers to the 'window' variable will not work. That
variable exists only in the main thread. So use MAIN_THREAD_EM_ASM()
instead.
Hardcode the document URL for now also in wasmapp.cpp.
Try to send the HULLO message from COOLWSD::innerMain().
Signed-off-by: Tor Lillqvist <tml@collabora.com>
Change-Id: Ic48042c6d0c6239a3b82e74f0565056a15f3d98d
After rework to grouped download as and also export
entry fro PDF and EPUB - these formats were not included.
Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
Change-Id: I91e5b25823017a3164fef2b63b2552e9893cf0b0
The default would be std:🧵:hardware_concurrency() which can be
ridiculously high for the WASM case.
Signed-off-by: Tor Lillqvist <tml@collabora.com>
Change-Id: I77902a58b96248d7afe638a039886712516fe905
If we are not caching tiles, it is misleading to log "Saved cache tile".
Signed-off-by: Tor Lillqvist <tml@collabora.com>
Change-Id: I0e0ec446d5edf266ea4acb42883c49d5f7063763
In some languages (de) some labels were being shifted and ultimately
cropped due to their length. Example: Using German; selecting an image
-> the 'Seitenverhältnis beibehalten' was being cropped
Remove padding for those labels when on the sidebar
Signed-off-by: Pedro Pinto Silva <pedro.silva@collabora.com>
Change-Id: I4097268682a1890543c9d2a8107e621ea15335c9