chore: add debug feedback

This commit is contained in:
yflory 2026-03-17 16:36:21 +01:00
parent 3061ce7da0
commit fb8461e974
3 changed files with 23 additions and 7 deletions

View File

@ -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),

View File

@ -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);

File diff suppressed because one or more lines are too long