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

Import bug fixes #3915

Closed
wants to merge 5 commits into from
Closed

Conversation

JohnMcLear
Copy link
Member

@JohnMcLear JohnMcLear commented Apr 21, 2020

  • ace2_inner.js needs top for any console warn
  • Close modal after succesfull import
  • Proper evaluation of directDatabaseAccess as it's a string not a bool.
  • Still todo. Fix duplicate page issue.

cc @seballot

@JohnMcLear JohnMcLear changed the title Import bug fixes - WIP Import bug fixes Apr 21, 2020
@muxator
Copy link
Contributor

muxator commented Apr 22, 2020

Does ace2_inner.js need top for only for console.warn() or for console.whatever() too?

Copy link
Contributor

@muxator muxator left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two problems:

  1. the server returns directDatabaseAccess === 'undefined' as a string. And we are adapting to that. This is a blocker for the release. It has to be fixed.
  2. to sidestep the two columns bug, we are thinking to perform a full page refresh after the import.
    I might be ok with releasing with this elegant fix, but only if we at least have a hint on what can be the root cause before releasing 1.8.3. Everyone wants to move on here.

So:

  • 1 -> blocker
  • 2 -> acceptable if we have a plan

src/static/js/pad_impexp.js Show resolved Hide resolved
}

// directDatabaseAccess is a string not a boolean
if(directDatabaseAccess !== 'undefined'){
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we really want to do this instead of finding the server side bug?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was doing this before.... This isn't new code, it's just fixing it up.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Look at this. May it be here?

var impexp = window.parent.padimpexp.handleFrameCall('" + req.directDatabaseAccess +"', '" + status + "'); \

src/static/js/pad_impexp.js Show resolved Hide resolved
@JohnMcLear
Copy link
Member Author

Does ace2_inner.js need top for only for console.warn() or for console.whatever() too?

.whatever too

@muxator
Copy link
Contributor

muxator commented Apr 22, 2020

.whatever too

ok, thanks. I'll commit a change for the whole ace2_inner.js. There are mixed console.whatever() statements there, and people may get confused.

@muxator muxator added this to the 1.8.3 milestone Apr 22, 2020
muxator added a commit to JohnMcLear/etherpad-lite that referenced this pull request Apr 22, 2020
@muxator muxator force-pushed the ace2_inner_warn branch 2 times, most recently from c1a2a13 to 45dfff1 Compare April 22, 2020 23:39
muxator added a commit that referenced this pull request Apr 23, 2020
@JohnMcLear
Copy link
Member Author


jose@server:~/etheretherpad-lite$ git bisect bad
5fd6aeeea62674cecf997421546a675d91cf45ef is the first bad commit
commit 5fd6aeeea62674cecf997421546a675d91cf45ef
Author: Sebastian Castro <sebastian.castro@protonmail.com>
Date:   Thu Apr 2 14:36:49 2020 +0200

    css: refactor element positioning

    No more javascript to change css properties
    Remove a number of useless tables
    Try to stop positioning elements with absolute, but use flex-boxes instead

    Adds comment to pad template, and move popups and chatbox inside editorcontainerbox (so absolute positioning is straightforward)

    Make the design more consistent: always use base color, font-family and font-size. USe relative font size if necessary (.9rem instead of 11px for example)

    Remove two columns in the popups, just use one column

    Remove css meant to support old browser (like -webkit-box-shadow, -moz-box-shadow). Those css rules are quite common now, and If we want to support very old browser, we should use clean-css or other tools to add them automatically

:040000 040000 978d82573baabc336d70aa1ddf2f7de12eba090e 5d24f199c525d3cab707d13f1a89d2b736a8f4d1 M   src

5fd6aee

@JohnMcLear
Copy link
Member Author

JohnMcLear commented Apr 23, 2020

Fault applies on both no-skin and colibiris. It was introduced in 5fd6aee by @seballot - I expect it was the change to pad.html.

Hrm, no, not pad.html or ace.js

@seballot
Copy link
Contributor

What is the problem here I don't understand?

@JohnMcLear
Copy link
Member Author

What is the problem here I don't understand?

For some reason your commit (above) is causing the duplicate frame issue on .etherpad import. I used git bisect to discover the cause.

@JohnMcLear
Copy link
Member Author

If you do git checkout 0603bf8097b6d3366d4c65435916a4e6f4c5536a which is the parent, then re-run Etherpad you will notice .etherpad file import works as expected (doesn't create two editors).

@JohnMcLear
Copy link
Member Author

@seballot I tried reverting the changes to pad.html and ace.js thinking that they surely were the cause but that didn't fix it. I'm at a bit of a loss.. I hope I have pointed you in the right direction though if you can take a look at your code to see if it's something obvious?

This is what I used to figure out this was the offending commit: https://mclear.co.uk/2013/04/02/using-git-bisect-to-debug-etherpad-issues/

@seballot
Copy link
Contributor

I had a look, but cannot understand either

@JohnMcLear
Copy link
Member Author

@seballot okay well I will take another look and see if I can figure it out!

2 similar comments
@JohnMcLear
Copy link
Member Author

@seballot okay well I will take another look and see if I can figure it out!

@JohnMcLear
Copy link
Member Author

@seballot okay well I will take another look and see if I can figure it out!

@JohnMcLear
Copy link
Member Author

Figured it out. Jesus what a nasty bug.. Good job @seballot this was 100% NOT your fault. This is my fault and your "good" code highlighted my sloppy job :)

image

Note the two ace_outer elements... This was in the older versions.... *sighs.. I need to nuke one before bringing the other one in..

@JohnMcLear
Copy link
Member Author

Fix #3925

@seballot
Copy link
Contributor

ohh so you mean the two iframe have always been there after import, but as they were positioned in absolute the last created was just on top of the old one ! Funny one ah ah

@JohnMcLear
Copy link
Member Author

Yes exactly :D *laughs in shame.

@muxator
Copy link
Contributor

muxator commented Apr 23, 2020

Kudos! Great job!

I am going to prepare the release during the weekend, since almost everything is ready (I have still a small problem with the doc generation, fix underway.

Just to be clear: #3925 and this PR go together, right?

@JohnMcLear
Copy link
Member Author

3925 does the job afaik, this isn't needed? Feel free to close.

@muxator
Copy link
Contributor

muxator commented Apr 26, 2020

Everything that was in this PR was integrated (e.g. closing of the modal after import, changes on logging in ace2_inner), or replaced with a better solution (e.g.: removing the duplicate iframe instead of reloading the page).

The only non merged change that is still contained in this PR is the following:

diff --git a/src/static/js/pad_impexp.js b/src/static/js/pad_impexp.js
--- a/src/static/js/pad_impexp.js
+++ b/src/static/js/pad_impexp.js
@@ -253,7 +253,8 @@ var padimpexp = (function()
         $('#import_export').removeClass('popup-show');
       }
 
-      if (directDatabaseAccess) {
+      // directDatabaseAccess is a string not a boolean
+      if (directDatabaseAccess !== 'undefined') {
         // Switch to the pad without redrawing the page
         pad.switchToPad(clientVars.padId);
         $('#import_export').removeClass('popup-show');

What problem did it fix?

If it is important, a proper fix should be done, maybe looking at

var impexp = window.parent.padimpexp.handleFrameCall('" + req.directDatabaseAccess +"', '" + status + "'); \

Closing, let's eventually open a new PR to define & fix this last issue.

@muxator muxator closed this Apr 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants