• Mahmoud Aglan's avatar
    fix(uploads): a temporary file that is gone is a sentence, not a 500 · d396f784
    Mahmoud Aglan authored
    Error eab81218-6482-47eb-9d09-aa54259069aa: an expense receipt, from an
    iPhone, at 16:22 today. League\Flysystem\UnableToRetrieveMetadata —
    "Unable to retrieve the file_size for livewire-tmp/Vy05fpe….jpg".
    
    Livewire uploads in two steps: the file lands in livewire-tmp on its own
    request, and the component reads it on a later one. Between those two the
    file can be gone — every push redeploys the container and livewire-tmp is
    not persistent, Livewire's own cleanup removes stale files, and a phone
    happily resends a form after the app has restarted. The first thing to
    touch the file is validation, because `max:5120` calls getSize(), so the
    receptionist standing at the desk with a receipt got an error page and a
    support code instead of a form.
    
    The file being gone is not exceptional, it is Tuesday. ChecksTemporaryUploads
    asks whether the pending upload still exists (treating an unreachable disk
    as gone rather than letting a storage exception reach the browser), clears
    the dead handle so the next attempt starts clean, and puts one Arabic
    sentence on the field: اختر الملف مرة أخرى وأعد الرفع.
    
    Applied to every component that reads an upload, not just the one that was
    reported — expense receipt and expense form, the three portal uploads
    (payment proof, documents, requests), branding images, the page builder,
    the gallery, the document wizard, the event wizard's cover and gallery
    photos, and the participant import.
    
    Also pins what the group roster already does with combined invoices, since
    it was worth proving rather than assuming: participants 219 and 97 each
    paid part of the federation card on an invoice shared with a kit, typed as
    free text, and the roster allocates the payment across the lines and shows
    the card's share against the price for that member's tier — 2,500 of 8,000
    and 2,000 of 6,000, both labelled أقساط.
    
    Full suite 325 tests on SQLite and on the restored tenant, no failures.
    Co-Authored-By: 's avatarClaude Opus 5 (1M context) <noreply@anthropic.com>
    d396f784
PortalPayProof.php 6.69 KB