Merge branch 'soon' into staging

pull/1/head
yflory 4 years ago
commit e5992c29fa

@ -1703,6 +1703,8 @@ define([
// There is an allow list: check if we can authenticate // There is an allow list: check if we can authenticate
if (!Array.isArray(allowed)) { return void cb('EINVAL'); } if (!Array.isArray(allowed)) { return void cb('EINVAL'); }
if (!store.loggedIn || !store.proxy.edPublic) { return void cb('EFORBIDDEN'); } if (!store.loggedIn || !store.proxy.edPublic) { return void cb('EFORBIDDEN'); }
onReadyEvt.reg(function () {
var rpc; var rpc;
var teamModule = store.modules['team']; var teamModule = store.modules['team'];
var teams = (teamModule && teamModule.getTeams()) || []; var teams = (teamModule && teamModule.getTeams()) || [];
@ -1724,6 +1726,7 @@ define([
rpc.send('COOKIE', '', function (err) { rpc.send('COOKIE', '', function (err) {
cb(err); cb(err);
}); });
});
}, },
onConnectionChange: function (info) { onConnectionChange: function (info) {
if (!info.state) { if (!info.state) {

@ -107,6 +107,20 @@ define([
// If we try to load an existing shared folder (isNew === false) but this folder // If we try to load an existing shared folder (isNew === false) but this folder
// doesn't exist in the database, abort and cb // doesn't exist in the database, abort and cb
nThen(function (waitFor) { nThen(function (waitFor) {
// XXX use a config.cache flag in the new branches
// If we don't have a network yet and we're pulling our own SF (no team id)
// Make sure we have a cache
if (!config.store.id && !config.store.network) {
Cache.getChannelCache(secret.channel, waitFor(function (err, res) {
if (err === "EINVAL") { // Cache not found
waitFor.abort();
store.manager.restrictedProxy(id, secret.channel);
// XXX unrestrict when we connect?
return void cb(null);
}
}));
}
}).nThen(function (waitFor) {
isNewChannel(null, { channel: secret.channel }, waitFor(function (obj) { isNewChannel(null, { channel: secret.channel }, waitFor(function (obj) {
if (obj.isNew && !isNew) { if (obj.isNew && !isNew) {
store.manager.deprecateProxy(id, secret.channel); store.manager.deprecateProxy(id, secret.channel);
@ -190,7 +204,7 @@ define([
validateKey: secret.keys.validateKey || undefined, validateKey: secret.keys.validateKey || undefined,
owners: owners owners: owners
}, },
//onRejected: onRejected // XXX not working onRejected: onRejected // XXX not working
}; };
var rt = sf.rt = Listmap.create(listmapConfig); var rt = sf.rt = Listmap.create(listmapConfig);
rt.proxy.on('cacheready', function () { rt.proxy.on('cacheready', function () {

Loading…
Cancel
Save