mirror of
https://github.com/cryptpad/cryptpad.git
synced 2026-09-14 11:05:41 +05:00
chore: add debug feedback
This commit is contained in:
parent
3061ce7da0
commit
fb8461e974
@ -1433,6 +1433,8 @@ const factory = (UserObject, Util, Hash,
|
||||
userObjects.forEach(function (uo) {
|
||||
const missing = uo.getMissingRtChannel();
|
||||
if (!missing) { return; }
|
||||
if (uo.readOnly) { missing._readOnly = true; }
|
||||
missing._sf = uo.id || false;
|
||||
all.push(missing);
|
||||
});
|
||||
return all;
|
||||
@ -1493,6 +1495,7 @@ const factory = (UserObject, Util, Hash,
|
||||
getTagsList: callWithEnv(getTagsList),
|
||||
getSecureFilesList: callWithEnv(getSecureFilesList),
|
||||
getSharedFolderData: callWithEnv(getSharedFolderData),
|
||||
isInSharedFolder: callWithEnv(_isInSharedFolder),
|
||||
// Store
|
||||
getChannelsList: callWithEnv(getChannelsList),
|
||||
addPad: callWithEnv(addPad),
|
||||
|
||||
@ -721,11 +721,14 @@ const factory = (Sortify, UserObject, ProxyManager,
|
||||
if (['doc', 'sheet', 'presentation'].includes(parsed.type)) {
|
||||
if (!pad.rtChannel) {
|
||||
return getRtChannelFromPad(pad, (err, rtChannel) => {
|
||||
const sf = s.manager.isInSharedFolder(data.path) ? 'SF' : 'MAIN';
|
||||
const key = 'ADDPAD_NO_RT_CHANNEL' ;
|
||||
const team = data.teamId ? 'TEAM' : 'OWN';
|
||||
if (!err) {
|
||||
const key = 'ADDPAD_NO_RT_CHANNEL' ;
|
||||
const team = data.teamId ? 'TEAM' : 'OWN';
|
||||
Feedback.send(`${key}:${team}`, true);
|
||||
Feedback.send(`${key}_${sf}:${team}`, true);
|
||||
pad.rtChannel = rtChannel;
|
||||
} else {
|
||||
Feedback.send(`${key}_${sf}_ERROR:${team}`, true);
|
||||
}
|
||||
add();
|
||||
});
|
||||
@ -2251,9 +2254,18 @@ const factory = (Sortify, UserObject, ProxyManager,
|
||||
|
||||
Store.fixMissingRtChannel = (cb) => {
|
||||
const all = {};
|
||||
const addMissing = (missing) => {
|
||||
const addMissing = (missing, isTeam) => {
|
||||
const team = isTeam ? 'TEAM' : 'OWN';
|
||||
missing.forEach(obj => {
|
||||
const readOnly = !!obj._readOnly;
|
||||
const sf = obj._sf ? 'SF' : 'MAIN';
|
||||
delete obj._readOnly;
|
||||
delete obj._sf;
|
||||
Object.keys(obj).forEach(chan => {
|
||||
if (readOnly) {
|
||||
Feedback.send(`MISSING_RT_CHANNEL_READONLY_${sf}:${chan}`, true);
|
||||
return;
|
||||
}
|
||||
let proxy = obj[chan];
|
||||
let href = proxy.roHref || proxy.href;
|
||||
all[chan] ||= {
|
||||
@ -2262,13 +2274,14 @@ const factory = (Sortify, UserObject, ProxyManager,
|
||||
list: []
|
||||
};
|
||||
all[chan].list.push(proxy);
|
||||
Feedback.send(`MISSING_RT_CHANNEL_${team}_${sf}:${chan}`, true);
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
try {
|
||||
const mine = store.manager.getMissingRtChannel();
|
||||
addMissing(mine);
|
||||
addMissing(mine, false);
|
||||
} catch (e) {
|
||||
Feedback.send('MISSING_RT_CHANNEL_ERROR', true);
|
||||
return setTimeout(cb);
|
||||
@ -2278,7 +2291,7 @@ const factory = (Sortify, UserObject, ProxyManager,
|
||||
const team = store.modules.team.getTeam(id);
|
||||
try {
|
||||
const teamMissing = team.manager.getMissingRtChannel();
|
||||
addMissing(teamMissing);
|
||||
addMissing(teamMissing, true);
|
||||
} catch (e) {
|
||||
Feedback.send('MISSING_RT_CHANNEL_ERROR', true);
|
||||
return setTimeout(cb);
|
||||
|
||||
2
www/common/worker.bundle.min.js
vendored
2
www/common/worker.bundle.min.js
vendored
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user