This commit introduces timer-less retry system:
1. Any change to URL is going to stop listening to any messages.
2. If a message is sent and there's no handler that could pick it up,
the message gets enqueued.
3. The message is sent again to the first handler that attaches itself
to given event type.
While in theory this is full of holes (no control over the first
handler), in practice, it works quite well.
Additionally, views.listenToMessages was attaching to completely wrong
DOM node; this commit fixes this as well.
- Change page number indicator
- Remove most of the scrolling cruft as it has no chance of working
anyway, thanks to our benevolent browsers
- Scroll to page header if the page is not the first one (I'm surprised
this even works)
- Use promises rather than timers
- Simplify top page detection using .elementFromPoint rather than
iterating over all pages. Coincidentally, this seems to work slightly
better
Post notes had mixed up column types. I fixed that and at the same time,
I took the opportunity to convert everything into Unicode. Also, I've
changed existing migrations rather than creating new ones - it's not
like we're even close to alpha...
On a test page with 50 tags, 158 queries were reduced to 3:
1. Get the authenticated user
2. Get tags for given page
3. Count all tags
Looks just about right.
This is to let user log in if their login cookie is broken (for example
when it refers to a non existing user). Normally, the client should
treat errors caused by cookie logins as temporary server failures,
inform the user about it and leave the cookie, so that when the server
is up again, all user needs to do is to reload the page rather than
logging again.
Anonymous is self explanatory.
Nobody is used solely to mark certain operation as unavailable even to
administrators (<- nobody is higher than administrator).