The error was:
a) being caused by strings being passed up through the error handler - instead of actual error objects.
b) more importantly, the 10 tries jsbin was attempting to get a new bin id, it was failing!!!! so I've increased the chances by adding uppercase characters (doubling the possibilties) and on each hit on an existing bin, the shortcode will get longer
node crashes and throws a error that 'results are not defined'.
This happens because of silly spelling mistake
in archiveBin in file lib/db/sqlite.js, see commit.
.
Sql query parameters as defined in lib/db/sql_template.json has github token and id at as last parameter. But, in lib/db/sqlite.json github_token is assigned where there should datetime value in last_login. Thus, resulting is error like "SQLITE CONSTRAINTS: ownership.last_login cannot be null" on console if github authentication is not used for login.
This commit attempts to fix that error and enable registering new users again.
This solution is obviously a hack, and doesn't provide the detected
content, but gets the history working again to browse. Something's
wrong with the innodb tables and causes the database to hang (looking
for help here!).
Ref #333
The old code would make one query for all the urls and revisions, then
loop and individual query each bin. If the user has 100+ bins, then it
gets slow and expensive because we can't group these queries together.
I've changed this so that the query simply joins the owners and sandbox
table, so instead of *just* getting the url and revision as previously,
we're now getting all the data in one request. I've also removed the
sorting as this happens entirely in the code.
The query, live for my own homepage is 1.13 seconds. I'm hoping
therefore the sum change of this update will reduce the 24 seconds down
to 1-2 seconds.
One additional change I'd like would be to only make the request for
the `/list` page if the user really goes there, or perhaps hovers over
their home link - as a preemptive request - so we're not always making
the request for their home urls.