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 // 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. // 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. 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. 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 channel = config.channel;
var lastKnownHash = config.lastKnownHash || -1; var lastKnownHash = config.lastKnownHash || -1;
if (config.newTeam) { // XXX
lastKnownHash = undefined;
}
var ref = { var ref = {
state: { state: {
members: { }, members: { },

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

Loading…
Cancel
Save