mirror of
https://github.com/cryptpad/cryptpad.git
synced 2026-09-14 11:05:41 +05:00
Merge remote-tracking branch 'origin/fix(trim-team-history)' into 2026-autumn-test-scalable
This commit is contained in:
commit
2c4879e628
6
.github/workflows/test-trigger.yml
vendored
6
.github/workflows/test-trigger.yml
vendored
@ -6,7 +6,7 @@ name: Trigger E2E tests
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ staging, 2026.9-rc, 2026.9-test ]
|
||||
branches: [ staging, 2026-autumn-rc, 2026-autumn-test ]
|
||||
|
||||
jobs:
|
||||
trigger-tests:
|
||||
@ -18,9 +18,9 @@ jobs:
|
||||
|
||||
if [ "$branch" = "staging" ]; then
|
||||
event_type="trigger-e2e-tests-staging"
|
||||
elif [ "$branch" = "2026.9-rc" ]; then
|
||||
elif [ "$branch" = "2026-autumn-rc" ]; then
|
||||
event_type="trigger-e2e-tests-rc"
|
||||
elif [ "$branch" = "2026.9-test" ]; then
|
||||
elif [ "$branch" = "2026-autumn-test" ]; then
|
||||
event_type="trigger-e2e-tests-test"
|
||||
fi
|
||||
|
||||
|
||||
@ -161,9 +161,18 @@ const factory = (Util, Hash, UserObject, nThen) => {
|
||||
|
||||
hash = obj[0].hash;
|
||||
var messages = obj.map(function(data) {
|
||||
return data.msg;
|
||||
try {
|
||||
// Remove txid from received messages
|
||||
let parsed = JSON.parse(data.msg);
|
||||
parsed[0] = 0;
|
||||
return JSON.stringify(parsed);
|
||||
} catch (e) {
|
||||
// Invalid message in history: should not happen
|
||||
return data.msg;
|
||||
}
|
||||
});
|
||||
dataSize = messages.join('\n').length;
|
||||
// +1 is there for the last new line
|
||||
dataSize = messages.join('\n').length + 1;
|
||||
}), true);
|
||||
}
|
||||
// Metadata
|
||||
@ -172,7 +181,8 @@ const factory = (Util, Hash, UserObject, nThen) => {
|
||||
}, waitFor(function (obj) {
|
||||
if (obj && obj.error) { return; }
|
||||
if (!obj || typeof(obj) !== "object") { return; }
|
||||
metadata = JSON.stringify(obj).length;
|
||||
// +1 is there for the last new line
|
||||
metadata = JSON.stringify(obj).length + 1;
|
||||
if (!obj || !Array.isArray(obj.owners) ||
|
||||
obj.owners.indexOf(edPublic) === -1) {
|
||||
waitFor.abort();
|
||||
|
||||
@ -430,10 +430,16 @@ define([
|
||||
]);
|
||||
UI.openCustomModal(UI.dialog.customModal(div, {buttons: []}));
|
||||
console.log('Trimming team history', APP.team, size);
|
||||
const removeModalsTimeout = setTimeout(() => {
|
||||
UI.removeModals();
|
||||
Feedback.send(`TRIM_HISTORY_TIMEOUT=${channels.map(obj => obj?.channel).join('|')}`, true);
|
||||
UI.warn(Messages.trimHistory_error);
|
||||
}, 120000);
|
||||
APP.history.execCommand('TRIM_HISTORY', {
|
||||
channels: channels
|
||||
}, function(obj) {
|
||||
if (obj && obj.error) { console.error(obj.error); }
|
||||
clearTimeout(removeModalsTimeout);
|
||||
UI.removeModals();
|
||||
});
|
||||
});
|
||||
|
||||
Loading…
Reference in New Issue
Block a user