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

Ordering list items by dragging fails with unpredictable results #3025

Closed
bobolous opened this issue Mar 7, 2014 · 41 comments
Closed

Ordering list items by dragging fails with unpredictable results #3025

bobolous opened this issue Mar 7, 2014 · 41 comments

Comments

@bobolous
Copy link

bobolous commented Mar 7, 2014

Hi

I have multiple problems on two different machines, when trying to drag Habits, Dailies and To-Dos to reorder them.

Note: There have been several attempts to raise this issue (eg #395 ) and they keep getting closed. Issue #318 is where user @lefnire was directing people but this thread was closed a while back with @paglias comment "The site has been totally rewritten from the ground up, I'm closing the issue since it's probably fixed."

My problems:

It looks like sometimes the drag simply doesn't work (the item snaps back), sometimes it moves but other items randomly swap around near it, or the item moves but to a random position in the list!

Spidey-sense tells me this earlier comment by @lefnire probably comes close to the mark but there's still no fix: #318 (comment)

I get the follow script errors when trying to drag (but not every time - sometimes the drag ordering doesn't work and I get no error at all):
4 Uncaught TypeError: Cannot read property 'id' of undefined app-c3073cfe.js:22
13 Uncaught TypeError: Cannot call method 'insertBefore' of null app-c3073cfe.js:18
65 Uncaught TypeError: Cannot call method 'insertBefore' of null

This drag-ordering problem is quite possibly related to the random reordering of list items (i.e. random reordering that occurs at times other than when dragging the items). See: #318 #395 and #1616

I also get this random (non-drag) reordering issue and it feel like it could be related given comment by @lefnire quoted above.

The combination of the random reordering and not being able to drag reorder my items is a serious problem for me (I'm new to HabitRPG and love it so far but as my list grows a bit and is now about where I want it, it's a real pain not being able to find things too well, even with tagging!)

@deilann
Copy link
Contributor

deilann commented Mar 7, 2014

Tickets that old are going to be a completely different architecture (Derby days), so any code talked about or problems are likely for different reasons. When you're talking about reordering issues, are you talking about To-Dos or other tasks?

@bobolous
Copy link
Author

bobolous commented Mar 7, 2014

Sorry, understood.

Yes. I'm talking about "trying to drag Habits, Dailies and To-Dos to reorder them."

When dragged they usually (and I mean more than 50% of the time!) snap back, or jump to unreleated positions or sometimes reorder the items around them.

@deilann
Copy link
Contributor

deilann commented Mar 7, 2014

kk, just wanted to make sure (I know you stated it, but you were also referring to old architecture and we have a known issue of To-Dos not reordering correctly so just wanted to check you weren't mixing the two)

How many habits/dailies would you estimate you have?

@bobolous
Copy link
Author

bobolous commented Mar 7, 2014

I have 25 Habits, 8 Dailies, 9 outstanding To-Dos, 1 Reward + the equipment rewards.

They are a mixture of items introduced by Challenges and some of my own, roughly half and half.

The problem with drag-ordering not working may have gotten worse as I added items. But maybe it's just more obvious now things can jump about more.

I have tried being careful and noting how/where I'm dropping the item - into a blank space that opens up, partly overlapping the item above or below, or on top of a speech bubble that pops up etc - I know that depending on the system exactly what the mouse is over at the point of the drop might make a difference. But it doesn't seem to related in anyway to this issue that I can see.

@bobolous
Copy link
Author

bobolous commented Mar 7, 2014

The issue also seems to come and go! I've just done some more testing now - on the same machine a few hours later - and it's working okay!

@deilann
Copy link
Contributor

deilann commented Mar 7, 2014

Were you possibly trying to reorder with a tag active? they're persistent
now

On Fri, Mar 7, 2014 at 3:56 AM, bobolous [email protected] wrote:

The issue also seems to come and go! I've just some more testing now - on
the same machine a few hours later - and it's working okay!

Reply to this email directly or view it on GitHubhttps://github.com//issues/3025#issuecomment-37017825
.

@bobolous
Copy link
Author

bobolous commented Mar 7, 2014

I was not filtering the results by tag earlier.

@deilann
Copy link
Contributor

deilann commented Mar 7, 2014

H'm. I know I've had problems with this in the past -- to the point of I
haven't tried to reorganize my stuff lately, but I know it's not a common
problem. Most people have only had issues reordering To-Dos. Which makes me
wonder what can be done to replicate it and what's causing the issue.

On Fri, Mar 7, 2014 at 4:48 AM, bobolous [email protected] wrote:

I was not filtering the results by tag earlier.

Reply to this email directly or view it on GitHubhttps://github.com//issues/3025#issuecomment-37020956
.

@snicker
Copy link
Contributor

snicker commented Mar 7, 2014

If you have multiple clients open, you run the risk of one client sending an order to the server that is completely different than the other. Are you making sure to test with only a single client and single machine?

@deilann
Copy link
Contributor

deilann commented Mar 7, 2014

@snicker I had this problem before touching Habit on a second machine (or
browser, or OS).

On Fri, Mar 7, 2014 at 5:59 AM, snicker [email protected] wrote:

If you have multiple clients open, you run the risk of one client sending
an order to the server that is completely different than the other. Are you
making sure to test with only a single client and single machine?

Reply to this email directly or view it on GitHubhttps://github.com//issues/3025#issuecomment-37025973
.

@snicker
Copy link
Contributor

snicker commented Mar 7, 2014

conjecture: it might be worth a try to manually sync with the server after you order your tasks. This forces the HRPG client to send an update to the server with everything, including item order data.

Occasionally, when you check off a task or +/- a habit, the server will see that it's got some information that you don't have client side (because of third party API access, or damage done by a boss in party, etc) and will send a forced update downstream. This may have the "server side" order if a client sync was not pushed to the server, causing your tasks to re-arrange.

@deilann
Copy link
Contributor

deilann commented Mar 7, 2014

H'm. I do always refresh to see if it's stuck, but syncing mighth be a good
idea.

@bobolous
Copy link
Author

bobolous commented Mar 7, 2014

I did have another client open on the phone potentially, but the Android client does not (to my knowledge) allow me to re-order tasks anyway, so I don't know why that would have caused such huge consequences.

Yesterday I used HabitRPG on another browser on another machine and did create and re-order some items then. I was fairly sure I had refreshed on the current browser first thing though because it knew I'd levelled up.

@snicker
Copy link
Contributor

snicker commented Mar 7, 2014

It causes huge consequences because the android client will re-send the task order, forcing the server to overwrite changes you may have made on another client.

@snicker
Copy link
Contributor

snicker commented Mar 7, 2014

and refreshing the browser is different than performing a sync.

@bobolous
Copy link
Author

bobolous commented Mar 7, 2014

Ok... So I guess I need to make sure I quit from other browsers and the Android app before using a new browser in case it corrupts the order?

But does this explain why a drag-and-drop action to re-order things manually would go so wrong? I suppose if the client in the browser thinks the order is one thing visually but the underlying data has been updated then it could be changing that data incorrectly on a drag and drop.

Obviously the ability to use both an the Android client and the browser without screwing up the order would be good! For me at least that is part of the attraction - that HabitRPG can sit on my work and home machine, and also be available to tick things off while on the move - (hopefully, eventually, without having to worry about whether they're in sync properly).

@snicker
Copy link
Contributor

snicker commented Mar 7, 2014

The ways to fix this are a little complicated, not from a coding standpoint, but from logistics. Here's a thought experiment for you:

  1. You open HRPG on a browser. HRPG gets a full sync from the server.
  2. You re-order your tasks on the browser, but do not press the sync button.
  3. You open your Android client. The order will not reflect the changes you just made on the browser because there was no sync performed.
  4. You press the sync button in the browser. Now your task order is stored server side.
  5. You do something that causes the Android client to send a full sync. Now the task order is overwritten on the server side.

@snicker
Copy link
Contributor

snicker commented Mar 7, 2014

There's really only one way to fix this from an application standpoint:

  1. store a separate "order" property on tasks that is not synchronized from clients that do not support modifying the order

or the other option is to sync your client side changes on your browser before opening the android client.

This is all dependent on the fact that my assumptions above are correct, and I haven't done any testing or code-mining to verify this yet

@deilann
Copy link
Contributor

deilann commented Mar 7, 2014

@snicker I'm well aware that refreshing is different than a sync. I refresh
to see if things were actually saved server-side, not to get them to save.

And I've had this problem without mobile or using Habit in any other
browsers, so it has to be something beyond this, although I am positive
that this could also be an issue for some people.

My guess would be that either the server isn't getting the request when I'm
reordering things, or there's an error with the request, keeping it from
fully executing.

@snicker
Copy link
Contributor

snicker commented Mar 7, 2014

right. We could force sending a task update to server upon reorder?

that might get expensive though as it's going to send the entire array.

@deilann
Copy link
Contributor

deilann commented Mar 7, 2014

The only issue I see with that is that when I'm reordering tasks, it's
usually a lot of reordering. That would be a lot of requests, if it
happened every time I moved a single task.

For usability's sake, I'd say having an "edit mode" in which you can
reorder your tasks, but not allow reordering outside of it. Then, you save
the reorder when you're done, and not have to rely on people knowing to
sync on their own.

@bobolous
Copy link
Author

bobolous commented Mar 7, 2014

I think that would certainly be preferable to the risk of making lots of changes and then finding it's turned to soup next time I log on somewhere else.

So you'd press Re-Order or similar, then move them about, then press the same button which now says Done, for example, which would force a sync.

Might not be great usability for someone who just ocassionaly wants to move a single task, though.

I'm surprised this isn't a more common issue but maybe using it across devices is actually rare? Or maybe my ocassional failure to hit update is the problem - but people are so used to changes being synced immediately these day (like Google Docs etc) that I can't quite believe that. The general user must not know/forget to press sync quite a bit!

@paglias
Copy link
Contributor

paglias commented Mar 7, 2014

@snicker

  1. You re-order your tasks on the browser, but do not press the sync button.

Even if you don't press sync it should be automaticcaly synced with the server I think

@snicker
Copy link
Contributor

snicker commented Mar 7, 2014

@paglias it does appear to be immediately syncing when I move my tasks around, you're right

@notalwaysweak
Copy link

I've had this issue where I've spent time dragging tasks around (I have over 30 in my to-dos because I'm doing a month-long challenge) and then they reorder themselves the next time I log in. All the reordering was done on my PC; I do use the tablet app but only to tick things off, I didn't move anything around.

@deilann
Copy link
Contributor

deilann commented Apr 10, 2014

@notalwaysweak If it's To-Dos, it's a different bug. That one has a pretty easy work around -- go to your completed to dos and click "clear completed." (Challenge To-Dos will remain, and that's fine.) This should fix your problem. :)

@TheCodeSinger
Copy link

Certainly multiple clients could cause issues, but there really is a plain and simple re-ordering bug.

Here's my description of the bug:

  1. Drag a To-Do to the top of the list
  2. Click Sync
  3. That item jumps back to where it was and (sometimes) a different item is now at the top of the list. But either way, the item I tried to move always returns to its position.

However, it is more goofy than that. If I reorder some of the recently added items, it seems OK. It may only be older (redder?) items which have the problem. But I haven't been able to pinpoint this consistently.

And the comment about clearing completed To-Dos is not relevant because I don't have any completed To-Dos (in the past three days).

@deilann
Copy link
Contributor

deilann commented Jul 25, 2014

To-Dos are a different problem than this.

And actually the comment about clearing completed To-Dos is relevant. It
may not look like it's doing anything, but it is. Promise.

On Thu, Jul 24, 2014 at 5:22 PM, David Close [email protected]
wrote:

Certainly multiple clients could cause issues, but there really is a plain
and simple re-ordering bug.

Here's my description of the bug:

  1. Drag a To-Do to the top of the list
  2. Click Sync
  3. That item jumps back to where it was and (sometimes) a different item
    is now at the top of the list. But either way, the item I tried to move
    always returns to its position.

However, it is more goofy than that. If I reorder some of the recently
added items, it seems OK. It may only be older (redder?) items which have
the problem. But I haven't been able to pinpoint this consistently.

And the comment about clearing completed To-Dos is not relevant because I
don't have any completed To-Dos (in the past three days).


Reply to this email directly or view it on GitHub
#3025 (comment).

@TheCodeSinger
Copy link

Wow. Thanks! I see what you mean. Clicking the button eliminated the problem. I hope you don't find my lack of faith disturbing.

It's as if when you complete a ToDo, the remaining items get their order ID updated in one place but not another. Then we you drag an item and sync, the page renders according to the order ID for each ToDo... however, those IDs are now mismatched.

I'm not sure what you mean when you say "To-Dos are a different problem than this." Than what? I'm describing my problem whereby To-Dos are "rearranged with unpredictable results," just like the title of the issue. This is the only open issue regarding dragging ToDos. Should I start a new issue for dragging ToDos? It may have a work-around but it's still an existing bug.

@deilann
Copy link
Contributor

deilann commented Jul 25, 2014

I mean this ticket is talking about another sorting issue, distinct from this one: #2606 which is the one you are looking for.

@TheCodeSinger
Copy link

Ooh.. fantastic. Good to add that number here in this discussion. Thanks!

@androidadvocate
Copy link

I am having the exact same problem. I did a search on github and discovered these are the exact same issue:

#3025
#2667
#3250
#1703

And MAY be related to: #2606

These two issues should be consolidated into one so we know which one to donate a bounty to.

@Alys
Copy link
Contributor

Alys commented Aug 20, 2014

@androidadvocate : Those are not all the same issue. Some deal with sorting to-dos, others deal with sorting habits and dailies - while they might seem similar, they have different technical challenges. See the response I have made to your first comment elsewhere: #3250 (comment)

1703 is for challenges which is something completely different again.

@mirihawk
Copy link

I'm not sure if my issue is the same or not. When I reorder my tasks, to dos and dailies they will not stay rearranged. A manual sync causes the tasks to jump back to their old spot. Is there something I need to do to save my new world order before synching? I have tried on both windows 8.1 and windows 7, both Firefox and IE. I'm willing to do testing after work if you let me know what would help you troubleshoot this issue. thanks in advance for your assistance.

@Alys
Copy link
Contributor

Alys commented Aug 26, 2014

@mirihawk : Problems with sorting To-Dos are common and are (almost?) always fixed by deleting your completed To-Dos. Go to the "Completed" To-Do tab and click on the "Delete Completed" button -- click it even if it looks like there are no To-Dos there! If you want to keep a copy of your completed To-Dos, read the advice that you'll find there before you click the button.

Are you certain that you also have a problem with sorting Dailies? That is much less common. If you do, please comment on #2667 and add your User ID.

@mirihawk
Copy link

The To-dos were the big problem, and deleting fixed them! Thanks.

@octern
Copy link

octern commented Sep 13, 2014

@Alys Could you elaborate on "read the advice that you'll find there before you click the button"? It just tells me that completed to-dos will be archived after 3 days -- does that mean that if I clear my completed to-dos, the ones on the list will be expunged from my records? That would be an unfortunate price to pay for being able to rearrange my remaining to-dos.

@Alys
Copy link
Contributor

Alys commented Sep 13, 2014

@octern : Hover over the Delete Completed button to see more specific information. But basically, yes, to answer your question. Note that unless you're a subscriber, I think your completed To-Dos are deleted after a while anyway. If you want to keep a permanent record of them, it's advisable to export them regularly.

@sersorrel
Copy link
Contributor

Just happened to me, the deleting completed to-dos workaround fixed it.

@perlsec
Copy link

perlsec commented Mar 6, 2015

This just happened to me. Deleting completed to-dos worked for me too.

@Alys
Copy link
Contributor

Alys commented May 18, 2015

The inability to sort To-Dos is covered in #2606

I don't think we still have a problem with sorting Habits and Dailies so I'm closing this. If anyone can't sort HABIT OR DAILIES, please comment here. (For To-Dos, read the information at the top of #2606 and you don't need to comment there or here.)

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

No branches or pull requests