Merge verified Odysseus fixes

This commit is contained in:
pewdiepie-archdaemon
2026-07-23 14:49:02 +00:00
parent 4c9a8ca115
commit d8a2059df8
117 changed files with 15693 additions and 3191 deletions
+14 -1
View File
@@ -3,22 +3,35 @@
import Storage from './storage.js';
function markComposerUserEdited() {
const msgInput = document.getElementById('message');
if (!msgInput || msgInput.dataset.startupPreserveBound === '1') return;
msgInput.dataset.startupPreserveBound = '1';
msgInput.addEventListener('input', () => {
window.__odysseusComposerUserEdited = !!msgInput.value;
});
}
function clearFreshComposerRestore() {
const msgInput = document.getElementById('message');
if (!msgInput) return;
markComposerUserEdited();
const hash = window.location.hash || '';
const isEntityHash = /^#(?:document|note|image|email|event|task|skill|research)-/.test(hash)
|| /^#open=notes&note=/.test(hash);
const hasSessionTarget = !!((hash && !isEntityHash) || Storage.get('lastSessionId'));
const hasSessionTarget = !!(hash && !isEntityHash);
if (hasSessionTarget) return;
if (window.__odysseusComposerUserEdited || document.activeElement === msgInput) return;
if (msgInput.value) {
msgInput.value = '';
msgInput.dispatchEvent(new Event('input', { bubbles: true }));
}
}
markComposerUserEdited();
clearFreshComposerRestore();
window.addEventListener('pageshow', clearFreshComposerRestore);
document.addEventListener('DOMContentLoaded', markComposerUserEdited, { once: true });
// SECURITY: defense-in-depth state wipe on user switch. If the authenticated
// user is different from the one whose state is cached in this browser,