Skip to content

Completely refactor and fix timeslider#2040

Closed
s1341 wants to merge 50 commits intoether:developfrom
s1341:fix_timeslider
Closed

Completely refactor and fix timeslider#2040
s1341 wants to merge 50 commits intoether:developfrom
s1341:fix_timeslider

Conversation

@s1341
Copy link
Copy Markdown
Contributor

@s1341 s1341 commented Dec 17, 2013

No description provided.

s1341 added 30 commits December 17, 2013 17:35
This commit introduces a new TimesliderClient object which will
eventually handle all communication with the server in a sane fashion.

At the moment, minimal work has been done to wire the existing code into
this object. The current 'on("MESSAGE_TYPE")' model will change so that
the timeslider object is actually the one managing all the information,
instead of delegating it all out to callbacks.

This current version still works just as the stock version did.
The slider handle and stars render correctly. Not yet wired up to real
events.
without this, the timeslider and sliderui classes don't work
Working slider class with mouse handling (click, drag) and events
(change, slide). Lots of console logs still in the code.

Got rid of some of the legacy code.
Also, the steppers actually work.
findPath works. transition requests changesets from server. processing
of changesets works correctly.

Only need to manage the async-ifying of transition, which is currently
written as a while loop, (with a short-circuit break for debugging).
There are still some weird kinks in the traversal algorithm. For
example, trying to go from 9 -> 19 fails very oddly.
There are still some bugs in the traversal algorithm, as well
as bugs being triggered in the server. Also, for some reason it looks
like there is a problem with the attribute pool not containing certain
elements.
Working:
  - location.hash
  - click on slider
  - stepper buttons
  - UI update (except authors)
Not working:
  - playback
  - bugs in transition code
Handle upstream new revisions and added users/authors.
Added HUGE (1000 revs) bucket. There are still some libchangeset errors
which need fixing.
@s1341
Copy link
Copy Markdown
Contributor Author

s1341 commented Dec 22, 2013

This is more or less ready. There are two outstanding issues with the changesets themselves, one of which must be resolved before we can move forward, as it leaves the pad in an unknown state:

Uncaught Error: Failed assertion: Can't have op.lines of 2 in attribution lines

I'd be grateful for some additional testing.

@JohnMcLear
Copy link
Copy Markdown
Member

We have frontend automated tests for this already: peep the timeslider files in https://github.com/ether/etherpad-lite/tree/develop/tests/frontend/specs

Hope that helps :)

@marcelklehr
Copy link
Copy Markdown
Contributor

author colors are only visible as long as you don't change the revision. Newly applied changesets don't add author colors, it seems.

@marcelklehr
Copy link
Copy Markdown
Contributor

And I get a lot of these, (especially when going back to rev#0)

TypeError: newdivs[0] is undefined

(1033 out of range 653)

@marcelklehr
Copy link
Copy Markdown
Contributor

(regarding that occupying char (TM)):
Running the following in the browser console (after having loaded HEAD-1 manually), always gives an Error: Failed assertion: mismatched apply: 330 / 329

var changeset = require('ep_etherpad-lite/static/js/changeset.js')
changeset.applyToAText(
  _this.revisionCache.head_revision.previous.small.value
, _this.clientVars.collab_client_vars.initialAttributedText
)

The error is thrown at this line: exports.assert(str.length == unpacked.oldLen, "mismatched apply: ", str.length, " / ", unpacked.oldLen);, so that means the passed string is one char longer than expected.

Considering that the changesets received from the server are invalid, the timeslider shouldn't work at all. The timeslider code prolly uses some line based apply method, that gives its best to cover up such mistakes, so that's why it still works somehow.

I suspect there's one \n at the end of initialattributedtext.text that doesn't belong there (there are two at the end)... But then that's how it's stored in the database :/

@s1341
Copy link
Copy Markdown
Contributor Author

s1341 commented Dec 30, 2013

Thanks for all the feedback. I'll probably only be able to do some more work on this tomorrow. The timeslider does do line-based changeset stuff.

@marcelklehr
Copy link
Copy Markdown
Contributor

Just wrote some assertions on the server, and it seems the server-side code is broken. -- ahem.. maybe not, I dunno, it's all very confusing

@s1341
Copy link
Copy Markdown
Contributor Author

s1341 commented Dec 30, 2013

@marcelklehr let's try to debug together tomorrow?

@marcelklehr
Copy link
Copy Markdown
Contributor

yea, let's see what we can do tomorrow.

It now does partial findPaths, builds the final path as it goes  and requests changesets for missing bits only.
@Gared
Copy link
Copy Markdown
Member

Gared commented Jan 12, 2014

The timeslider looks very good, but it seems very slow if you have multiple revisions and/or change very fast between them. Sometimes it hangs and take a while till it jumps to the selected revision.

@s1341
Copy link
Copy Markdown
Contributor Author

s1341 commented Jan 13, 2014

There are still a few bugs and changes that need to be fixed/made. I unfortunately haven't had much time to work on this in the last couple of weeks. Hopefully I'll have some time later this week.

This was referenced Jan 23, 2014
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I guess this was written with the assumption that the timeslider would run on the same page as the editor... (so, the editorbox would have to be moved down)

@marcelklehr marcelklehr mentioned this pull request Jan 26, 2014
@JohnMcLear
Copy link
Copy Markdown
Member

I guess this can be closed in favor of @marcelklehr 's pull request?

cc @s1341

@JohnMcLear
Copy link
Copy Markdown
Member

Closing as we have another PR that supersedes this~- Thanks to @s1341 for his work!

@JohnMcLear JohnMcLear closed this Dec 29, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants