Skip to content

feat: handle post_max_size and upload_max_filesize - #1190

Open
Ashim-Stha wants to merge 5 commits into
masterfrom
handle-max-size-error
Open

Ashim-Stha wants to merge 5 commits into
masterfrom
handle-max-size-error

Conversation

@Ashim-Stha

@Ashim-Stha Ashim-Stha commented Oct 7, 2026 •

Copy link
Copy Markdown
Collaborator

Description

  • handled post_max_size error
  • handled upload_max_filesize and other related errors
  • moved the upload file functionality to the service from the controller
  • added some unit tests and updated relevant unit tests
  • updated relevant api tests

Related Issue or Workpackage

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Tests only (no source changes)

Checklist:

  • Code changes
  • Unit tests added
  • Acceptance tests added
  • Updated CHANGELOG.md file

@Ashim-Stha Ashim-Stha self-assigned this Oct 7, 2026
@Ashim-Stha
Ashim-Stha force-pushed the handle-max-size-error branch 29 times, most recently from af9ac32 to 60d2cb6 Compare October 13, 2026 04:19
Comment thread lib/Service/DirectUploadService.php Resolved
Comment thread lib/Service/DirectUploadService.php Resolved

@saw-jan saw-jan left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need a changelog

@Ashim-Stha
Ashim-Stha force-pushed the handle-max-size-error branch 10 times, most recently from 5a41fe0 to f7556a2 Compare October 28, 2026 06:22
@Ashim-Stha
Ashim-Stha requested a review from saw-jan October 28, 2026 06:52
@nextcloud nextcloud deleted a comment from github-actions Bot Oct 28, 2026
Comment thread lib/Service/DirectUploadService.php Resolved
Comment thread lib/Service/DirectUploadService.php Resolved
Comment thread lib/Service/DirectUploadService.php Resolved
Comment thread lib/Service/DirectUploadService.php Resolved
Comment thread lib/Service/DirectUploadService.php Resolved
@Ashim-Stha
Ashim-Stha force-pushed the handle-max-size-error branch 3 times, most recently from 1f539f7 to 52f0ddb Compare October 30, 2026 06:17
Signed-off-by: Ashim Shrestha <ashimshrestha2384@gmail.com>
Signed-off-by: Ashim Shrestha <ashimshrestha2384@gmail.com>
Signed-off-by: Ashim Shrestha <ashimshrestha2384@gmail.com>
Signed-off-by: Ashim Shrestha <ashimshrestha2384@gmail.com>
Signed-off-by: Ashim Shrestha <ashimshrestha2384@gmail.com>
| file_name | "" |
| data | some data |
Then the HTTP status code should be "413"
Then the HTTP status code should be "400"

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

An empty file name means no file is received, so this is a bad request (400), not content too large (413)

@github-actions

github-actions Bot commented Nov 5, 2026

Copy link
Copy Markdown

PHP Code Coverage

Coverage after merging handle-max-size-error into master will be
71.61%
Coverage Report
FileStmtsBranchesFuncsLinesUncovered Lines
integration_openproject/server/apps/integration_openproject/lib
   Capabilities.php0%100%0%0%24, 31–40
   OIDCClientMapper.php0%100%0%0%29, 40–49, 52
   ServerVersion.php0%100%0%0%17, 27–29, 32, 41–42
   TokenEventFactory.php100%100%100%100%
integration_openproject/server/apps/integration_openproject/lib/AppInfo
   Application.php37.04%100%50%36%116–118, 121–135, 138, 140, 142–143, 146, 151–152, 156–159, 161–172, 174, 177, 181, 185–187, 220
integration_openproject/server/apps/integration_openproject/lib/AuditLog
   Operation.php100%100%100%100%
integration_openproject/server/apps/integration_openproject/lib/BackgroundJob
   RemoveExpiredDirectUploadTokens.php0%100%0%0%28, 30–32, 41–42
integration_openproject/server/apps/integration_openproject/lib/Controller
   ConfigController.php87.47%100%88.89%87.40%209, 395–397, 399–401, 450, 546, 562–565, 573, 577–580, 622–637, 678, 682–684, 686–688, 693–696, 713–716
   DirectDownloadController.php0%100%0%0%33–35, 50–52, 54–61
   DirectUploadController.php53.45%100%75%52.68%128–130, 192–195, 198–204, 206, 208, 214–216, 224–226, 228–230, 232–234, 239–250, 253–257, 266–267, 270–272, 276–278
   FilesController.php85.83%100%83.33%85.95%181–182, 246, 255, 272–275, 280–282, 287–289, 301, 303, 306
   OpenProjectAPIController.php81.09%100%82.35%80.98%116, 155, 202–204, 207–214, 216–220, 222, 241, 266, 331, 381, 401, 448, 473–475, 478–482, 484, 66
   OpenProjectController.php96.45%100%80%96.95%241–245
integration_openproject/server/apps/integration_openproject/lib/Dashboard
   OpenProjectWidget.php0%100%0%0%101, 108–109, 111–116, 118–122, 124–126, 129–140, 61–66, 73, 80, 87, 94
integration_openproject/server/apps/integration_openproject/lib/Exception
   OpenprojectAvatarErrorException.php100%100%100%100%
   OpenprojectErrorException.php100%100%100%100%
   OpenprojectFileNotUploadedException.php100%100%100%100%
   OpenprojectGroupfolderSetupConflictException.php100%100%100%100%
   OpenprojectResponseException.php100%100%100%100%
   OpenprojectUnauthorizedUserException.php100%100%100%100%
integration_openproject/server/apps/integration_openproject/lib/Listener
   BeforeGroupDeletedListener.php100%100%100%100%
   BeforeNodeInsideOpenProjectGroupfilderChangedListener.php0%100%0%0%46–48, 52–55, 57, 59, 62–63, 65, 67–70, 72–75, 77–79
   BeforeUserDeletedListener.php40%100%50%37.50%30, 38, 42–43, 45
   LoadAdditionalScriptsListener.php0%100%0%0%37–38, 46–47, 49, 51–52, 54
   LoadSidebarScript.php65.91%100%100%64.29%105, 77–88, 95, 98
   OpenProjectReferenceListener.php0%100%0%0%45–47, 54–55, 57, 59–60, 62–74
   TermsOfServiceEventListener.php0%100%0%0%41–42, 47–48, 50–51, 53–55, 58–62
   UserChangedListener.php0%100%0%0%34, 41–42, 45–50, 53
   UserLoggedInEventListener.php0%100%0%0%27, 35–36, 39, 42
integration_openproject/server/apps/integration_openproject/lib/Migration
   Version2001Date20221213083550.php0%100%0%0%30, 41–43, 46–54, 56–64, 66–68, 70
   Version20100Date20250820101358.php0%100%0%0%38, 47–53, 56
   Version2310Date20230116153411.php0%100%0%0%29, 32–35, 37–62, 64–65, 67
   Version2400Date20230504144300.php0%100%0%0%30, 41–44, 46
   Version2640Date20240628114301.php0%100%0%0%35, 47–49, 52–53, 56
   Version2900Date20250718065820.php0%100%0%0%22, 33–36, 38–39, 41–42, 45
integration_openproject/server/apps/integration_openproject/lib/Reference
   WorkPackageReferenceProvider.php51.67%100%25%58.33%100–101, 104, 108, 142, 150–151, 159, 37, 44, 51, 58–60, 87, 93–96, 99
integration_openproject/server/apps/integration_openproject/lib/Search
   OpenProjectSearchProvider.php0%100%0%0%100–102, 104–106, 109–110, 112–113, 116–125, 127–131, 52–55, 62, 69, 77, 79, 82, 89–90, 93–97, 99
   OpenProjectSearchResultEntry.php100%100%100%100%
integration_openproject/server/apps/integration_openproject/lib/Service
   DatabaseService.php42.31%100%60%40.43%108–112, 114, 63–76, 78–85
   DirectDownloadService.php100%100%100%100%
   DirectUploadService.php74.32%100%80%73.91%111, 167, 174, 200, 203, 78–81, 83–91
   OauthService.php96.15%100%100%95.65%124, 144
   OpenProjectAPIService.php79.88%100%80.28%79.84%1018–1019, 1021, 1023–1024, 1071–1073, 1075–1077, 1080–1084, 1086–1088, 1098–1101, 1104–1106, 1108, 1111

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants