HEX
Server: LiteSpeed
System: Linux houston.panomity.com 6.8.0-100-generic #100-Ubuntu SMP PREEMPT_DYNAMIC Tue Jan 13 16:40:06 UTC 2026 x86_64
User: nudepix (1011)
PHP: 7.4.33
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Upload Files
File: //proc/thread-self/root/tmp/bm_upload_cancel_patch.cjs
const fs = require('fs');
function replaceExact(file, from, to) {
  let s = fs.readFileSync(file, 'utf8');
  if (!s.includes(from)) throw new Error(`Missing expected text in ${file}: ${from.slice(0,160)}`);
  s = s.replace(from, to);
  fs.writeFileSync(file, s, 'utf8');
}
replaceExact('web/src/modules/photos/UploadPage.jsx',
`  const pendingPickerRef = useRef(null);
  const seenPickerSurfacesRef = useRef(new Set());`,
`  const pendingPickerRef = useRef(null);
  const pickerCancelTimerRef = useRef(null);
  const seenPickerSurfacesRef = useRef(new Set());`);
replaceExact('web/src/modules/photos/UploadPage.jsx',
`    const pending = pendingPickerRef.current;
    if (!pending) return false;
    pendingPickerRef.current = null;
    void trackEvent('upload_file_picker_cancel', {`,
`    const pending = pendingPickerRef.current;
    if (!pending) return false;
    if (pickerCancelTimerRef.current) {
      window.clearTimeout(pickerCancelTimerRef.current);
      pickerCancelTimerRef.current = null;
    }
    pendingPickerRef.current = null;
    void trackEvent('upload_file_picker_cancel', {`);
replaceExact('web/src/modules/photos/UploadPage.jsx',
`    const actualSurface = file ? 'replace_photo' : surface;
    pendingPickerRef.current = { surface: actualSurface, at: Date.now() };
    void trackEvent('upload_file_picker_click', {`,
`    const actualSurface = file ? 'replace_photo' : surface;
    if (pickerCancelTimerRef.current) window.clearTimeout(pickerCancelTimerRef.current);
    const pendingAt = Date.now();
    pendingPickerRef.current = { surface: actualSurface, at: pendingAt };
    pickerCancelTimerRef.current = window.setTimeout(() => {
      const stillPending = pendingPickerRef.current;
      const inputHasFile = Boolean(inputRef.current?.files?.length);
      if (!stillPending || stillPending.at !== pendingAt || inputHasFile) return;
      recordPickerCancel('timeout_no_selection');
    }, 12000);
    void trackEvent('upload_file_picker_click', {`);
replaceExact('web/src/modules/photos/UploadPage.jsx',
`    if (!f) return;
    pendingPickerRef.current = null;
    const normalizedType = String(f.type || '').toLowerCase();`,
`    if (!f) return;
    if (pickerCancelTimerRef.current) {
      window.clearTimeout(pickerCancelTimerRef.current);
      pickerCancelTimerRef.current = null;
    }
    pendingPickerRef.current = null;
    const normalizedType = String(f.type || '').toLowerCase();`);
replaceExact('web/src/modules/photos/UploadPage.jsx',
`      window.removeEventListener('focus', recordFocusCancel);
      document.removeEventListener('visibilitychange', recordVisibilityCancel);
      input?.removeEventListener?.('cancel', recordNativeCancel);
    };`,
`      window.removeEventListener('focus', recordFocusCancel);
      document.removeEventListener('visibilitychange', recordVisibilityCancel);
      input?.removeEventListener?.('cancel', recordNativeCancel);
      if (pickerCancelTimerRef.current) {
        window.clearTimeout(pickerCancelTimerRef.current);
        pickerCancelTimerRef.current = null;
      }
    };`);
for (const file of ['scripts/growth-smoke-check.mjs', 'scripts/growth-journey-smoke-check.mjs']) {
  let s = fs.readFileSync(file, 'utf8');
  if (!s.includes('timeout_no_selection')) {
    s = s.replaceAll("'upload_file_picker_click'", "'upload_file_picker_click', 'upload_file_picker_cancel', 'pickerCancelTimerRef', 'timeout_no_selection'");
  }
  fs.writeFileSync(file, s, 'utf8');
}