refactor(chat): Upload shared files with the single implementation - #2642
Merged
Conversation
SystemKeeper
force-pushed
the
chore/noid/unify-chat-file-uploads
branch
from
August 9, 2026 13:11
2d44321 to
4c46122
Compare
Assisted-by: ClaudeCode:claude-opus-4-8 Signed-off-by: Ivan Sein <ivan@nextcloud.com>
Assisted-by: ClaudeCode:claude-opus-4-8 Signed-off-by: Ivan Sein <ivan@nextcloud.com>
Assisted-by: ClaudeCode:claude-opus-4-8 Signed-off-by: Ivan Sein <ivan@nextcloud.com>
SystemKeeper
force-pushed
the
chore/noid/unify-share-sheet-upload
branch
from
August 9, 2026 13:40
e5e1c57 to
648f319
Compare
Signed-off-by: Marcel M眉ller <marcel-mueller@gmx.de>
SystemKeeper
approved these changes
Aug 9, 2026
Comment on lines
+58
to
+59
| try await self.put(upload, to: destination, progress: { progress?(index, $0) }, mayCreateAttachmentFolder: true) | ||
| try await self.announce(upload, at: destination) |
Collaborator
There was a problem hiding this comment.
One thing we should try to do in a followup is to retain the order of the shares.
Comment on lines
+695
to
+708
| private func message(for error: Error) -> String { | ||
| switch error { | ||
| case ChatFileUploadError.destinationUnavailable: | ||
| return NSLocalizedString("Could not prepare upload folder", comment: "") | ||
| case ChatFileUploadError.attachmentFolderUnavailable: | ||
| return NSLocalizedString("Failed to check or create attachment folder", comment: "") | ||
| case ChatFileUploadError.quotaExceeded: | ||
| return NSLocalizedString("User storage quota exceeded", comment: "") | ||
| case ChatFileUploadError.tooManyRequests: | ||
| return NSLocalizedString("Too many requests, please try again later", comment: "") | ||
| case ChatFileUploadError.uploadFailed(_, let errorDescription): | ||
| return errorDescription | ||
| default: | ||
| return error.localizedDescription |
Collaborator
There was a problem hiding this comment.
Very similar to the one in BsaeChatTableViewcontroller. Might make sense to check if we can unify them.
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.
Fourth and last refactoring step, on top of #2641. This is the one that removes the second upload
implementation:
ShareConfirmationViewControllerhad its own copy becauseChatFileUploaderwasnot part of the ShareExtension target.
upload()to the uploader: one draft folder request for the whole batch, uploadsrunning concurrently, one result per file
ShareConfirmationViewControllerand deletesstartUploads(),uploadFile()and thedispatch group and error/success lists around them
in the input bar
Quota and rate limit failures now show the strings the app has for them instead of the ones from
NextcloudKit.
馃 AI (if applicable)