Fix xhr responsetext crash#2521
Closed
victoritis wants to merge 542 commits intofilesender:developmentfrom
Closed
Conversation
* remove debug "hi there" * remove total from data_per_day_graph as it is on the graph next to it * Add/Use transferssizeidpview * add loading balls to statistics_page * add missing h3 * clean up graph divs * more UX stuff for tables
* remove debug "hi there" * fix SQL joins for idp linking * add browserstatsview, to speed up browserstats table for admins * fix idp join for stats page query in template * prefer DBLayer::timeStampToEpoch() over UNIX_TIMESTAMP() * nicer js loading animation/padding
* a few typeOs * PHP Notice: Only variables should be passed by reference
* first go at adding idp in path * rework storage_filesystem_per_idp
…ilesender#2120) New option to allow the path from storage to be stored per file in the database. This is the first step towards allowing various settings like per day buckets and idp in the storage path to be changed and existing files continue to be downloadable. This PR only optionally stores the path. A future PR will allow that information to be used and this allow storage settings to change and existing files (uploaded with this new storage_filesystem_explicitly_store_subpath_per_file enabled) to continue to be downloaded in the face of settings changes.
also move to the dbobject api to keep it simple.
* fix typeO * make filesbywhoview a left join * more views that should be LEFT JOINs * typeOs * fix mime_type query as it was mixing user/auth ids
…adb (filesender#2136) * . * . * . * . * . * . * .
* Revert default changes where there is no clear benefit
* fix typeO * fix Joins on recipientsidpview
* fix typeO * add transfersfilesidpview
* fix typeO * g for Guests makes more sense than t * remove d2/d5 as not needed and use existing views where possible
* fix typeO in sql in statistics_transfers_speeds_graph.php
- Filter duplicate languages - Only show if there are multiple languages configured
…e-update d3: update the icon names after the fa version bump
…ports-2025-12-25-1766606266 i18n: ui3: auto import from poedtor on 2025-12-25-1766606266
…n-string-update-for-release-3.1 bump in build version number
use the new randomuid name for this call too
…-string-update-for-release-3.2 bump in build version number
Fa 7.1 Uplift
seems f['size'] is now a string? Let's cast it as an int in python
…sion-bump mariadb min version bump
…-string-update-for-release-3.3 bump in build version number
Add `selectable_transfer_days_valid` and `selectable_guest_days_valid` to the config file, allowing administrators to define custom expiry date options in the Upload and Guest forms.
Add customizable expiry date options
…b-info-copy-out 2026/jan/docs mariadb info copy out
…tail-pass-token read and send token if it is valid
This seems to have been left out with the efficiency updates.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR fixes a JavaScript crash that occurs during large file uploads, particularly in Firefox when network instability (HTTP/3/QUIC resets) causes XHR responses to be empty or undefined.
The Problem
When uploading large files, FileSender uses Terasender workers to upload chunks in parallel. If a network error occurs (timeout, connection reset, HTTP/3 instability), the XHR
responseTextproperty may beundefinedinstead of a string.The current code attempts to call
.replace()directly onresponseText:This causes a
TypeError: Cannot read property 'replace' of undefined, which:Affected files:
www/js/client.js(line 227) - General API error handlingwww/js/terasender/terasender_worker.js(line 508) - Chunk upload error handlingThe Solution
Added defensive null-checking before accessing
responseText:This ensures:
responseTextexists → Works exactly as beforeresponseTextis undefined/null → Uses empty string, preventing crashImpact
Files Modified
www/js/client.js(line 227)www/js/terasender/terasender_worker.js(line 508)Type of change
How Has This Been Tested?
Tested in production environment with Firefox where HTTP/3 network resets were causing upload failures on large files (500MB+). After applying the fix, uploads complete successfully with automatic retries when network hiccups occur.