Fix team creation

pull/1/head
yflory 4 years ago
parent 4401c7c519
commit 6f1caf3540

@ -685,7 +685,7 @@ const handleGetHistory = function (Env, Server, seq, userId, parsed) {
// If we're asking for a specific version (lastKnownHash) but we receive an
// ENOENT, this is not a pad creation so we need to abort.
if (err && err.code === 'ENOENT' && lastKnownHash) {
if (err && err.code === 'ENOENT' && lastKnownHash) { // XXX && lastKnownHash !== -1
/*
This informs clients that the pad they're trying to load was deleted by its owner.
The user in question might be reconnecting or might have loaded the document from their cache.

@ -503,6 +503,10 @@ var factory = function (Util, Hash, CPNetflux, Sortify, nThen, Crypto, Feedback)
var channel = config.channel;
var lastKnownHash = config.lastKnownHash || -1;
if (config.newTeam) { // XXX
lastKnownHash = undefined;
}
var ref = {
state: {
members: { },

@ -691,10 +691,12 @@ define([
keys: rosterKeys,
store: ctx.store,
lastKnownHash: void 0,
newTeam: true,
Cache: Cache
}, waitFor(function (err, _roster) {
if (err) {
waitFor.abort();
console.error(err);
return void cb({error: 'ROSTER_ERROR'});
}
roster = _roster;

Loading…
Cancel
Save