[PR #524] [MERGED] ResumableJS fault tolerant attachment upload #871

Closed
opened 2026-02-25 21:36:29 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/cypht-org/cypht/pull/524
Author: @henrique-borba
Created: 10/24/2021
Status: Merged
Merged: 1/19/2022
Merged by: @jasonmunro

Base: masterHead: resumablejs-attachments


📝 Commits (10+)

  • 8f99dac ResumableJS fault tolerant attachment upload
  • 29b8859 Minified ResumableJS, site settings chunk clear and bug fixes
  • e03bb4b Fixed submission of finished drafts, correct SMTP account selection bug
  • 52c514a ResumableJS code review changes
  • 1397ec6 Chunk upload don't need the profile information
  • 829d206 Make sure attachment chunks removal are actually chunks parts
  • 33807ba Merge branch 'master' into resumablejs-attachments
  • b519ed7 If legacy load of profiles fails, just return an empty array. (PHP 8.1 don't like Exception so we use Throwable and make sure we still have compatibility with 5.4
  • 5352b81 Fixed wrong attachment directory used after file collision protection using smtp_id
  • b60fb79 A better and more secure way to remove chunks

📊 Changes

10 files changed (+491 additions, -223 deletions)

View changed files

📝 composer.json (+2 -1)
📝 lib/dispatch.php (+13 -1)
📝 modules/core/output_modules.php (+1 -0)
📝 modules/profiles/hm-profiles.php (+14 -1)
📝 modules/smtp/modules.php (+315 -128)
📝 modules/smtp/setup.php (+41 -24)
📝 modules/smtp/site.css (+5 -1)
📝 modules/smtp/site.js (+98 -67)
📝 scripts/config_gen.php (+1 -0)
third_party/resumable.min.js (+1 -0)

📄 Description

This PR aims to redo the attachment upload methods using ResumableJS.

Screen

Screenshot_20211023_220605

Screenshot_20211026_110858

Features

  • Fault Tolerant upload that allows you to pause or resume an upload that failed due to network issues
  • Due to the chunky nature of ResumableJS, very large files can be uploaded without breaking HTML5 Upload API limits or HTTP body size limits sent to the server.
  • Now we have a progress bar
  • If the user leaves the message composition screen and returns later, the upload will continue from the last piece of the partially uploaded file, preventing the loss of upload progress.
  • This update will fix most of the current issues related to attachments and draft attachments
  • The administrator will be able to clean up the partial chunks of unused files, this prevents storage limit issues and excessive garbage growth

Important

  • Drafts will not be automatically saved after uploading or removing a file. The user must ALWAYS press the save button to save their changes after send/remove attachments (this can be changed easily, but I found it more intuitive)
  • Session Cache will no longer be used to manage attachments

Core Updates

  • This update allows the hm_ajax_hook to be sent via a GET parameter

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/cypht-org/cypht/pull/524 **Author:** [@henrique-borba](https://github.com/henrique-borba) **Created:** 10/24/2021 **Status:** ✅ Merged **Merged:** 1/19/2022 **Merged by:** [@jasonmunro](https://github.com/jasonmunro) **Base:** `master` ← **Head:** `resumablejs-attachments` --- ### 📝 Commits (10+) - [`8f99dac`](https://github.com/cypht-org/cypht/commit/8f99dac841a41665fdb049b8841b34828ee6715e) ResumableJS fault tolerant attachment upload - [`29b8859`](https://github.com/cypht-org/cypht/commit/29b88596b7bc7a4c69261e26f1c4f4c7651aa3aa) Minified ResumableJS, site settings chunk clear and bug fixes - [`e03bb4b`](https://github.com/cypht-org/cypht/commit/e03bb4bd1501f021f06416a5146725e7f88a912a) Fixed submission of finished drafts, correct SMTP account selection bug - [`52c514a`](https://github.com/cypht-org/cypht/commit/52c514a8db32abd41ad2785714ce308b2172b6f2) ResumableJS code review changes - [`1397ec6`](https://github.com/cypht-org/cypht/commit/1397ec625aaa1d0b807cb2932dd6bd9e327db80d) Chunk upload don't need the profile information - [`829d206`](https://github.com/cypht-org/cypht/commit/829d206010264097971c1c80b573324483994119) Make sure attachment chunks removal are actually chunks parts - [`33807ba`](https://github.com/cypht-org/cypht/commit/33807ba772b0a07934d9b41850eb2d2e6c5fb249) Merge branch 'master' into resumablejs-attachments - [`b519ed7`](https://github.com/cypht-org/cypht/commit/b519ed7d0d1dc773ed6cc7ed8b22fb4bc3ac0367) If legacy load of profiles fails, just return an empty array. (PHP 8.1 don't like Exception so we use Throwable and make sure we still have compatibility with 5.4 - [`5352b81`](https://github.com/cypht-org/cypht/commit/5352b81cd03beee844b13e73df6423ca14452216) Fixed wrong attachment directory used after file collision protection using smtp_id - [`b60fb79`](https://github.com/cypht-org/cypht/commit/b60fb791eb48285d8d3eee7071be71310b9379a2) A better and more secure way to remove chunks ### 📊 Changes **10 files changed** (+491 additions, -223 deletions) <details> <summary>View changed files</summary> 📝 `composer.json` (+2 -1) 📝 `lib/dispatch.php` (+13 -1) 📝 `modules/core/output_modules.php` (+1 -0) 📝 `modules/profiles/hm-profiles.php` (+14 -1) 📝 `modules/smtp/modules.php` (+315 -128) 📝 `modules/smtp/setup.php` (+41 -24) 📝 `modules/smtp/site.css` (+5 -1) 📝 `modules/smtp/site.js` (+98 -67) 📝 `scripts/config_gen.php` (+1 -0) ➕ `third_party/resumable.min.js` (+1 -0) </details> ### 📄 Description This PR aims to redo the attachment upload methods using ResumableJS. ## Screen ![Screenshot_20211023_220605](https://user-images.githubusercontent.com/1107499/138576015-c7a6f4fd-4738-4031-b403-812dbe3dba44.png) ![Screenshot_20211026_110858](https://user-images.githubusercontent.com/1107499/138896187-5c76331a-f0bd-4a10-b12c-2d1b1e7834a1.png) ## Features - Fault Tolerant upload that allows you to pause or resume an upload that failed due to network issues - Due to the chunky nature of ResumableJS, very large files can be uploaded without breaking HTML5 Upload API limits or HTTP body size limits sent to the server. - Now we have a progress bar - If the user leaves the message composition screen and returns later, the upload will continue from the last piece of the partially uploaded file, preventing the loss of upload progress. - This update will fix most of the current issues related to attachments and draft attachments - The administrator will be able to clean up the partial chunks of unused files, this prevents storage limit issues and excessive garbage growth ## Important - Drafts will not be automatically saved after uploading or removing a file. The user must ALWAYS press the save button to save their changes after send/remove attachments (this can be changed easily, but I found it more intuitive) - Session Cache will no longer be used to manage attachments ## Core Updates - This update allows the hm_ajax_hook to be sent via a GET parameter --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-25 21:36:29 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/cypht#871
No description provided.