Auto-upload: with "delete from camera roll" active, photos that are already present on the server are not deleted from the camera roll
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
- #4395 @mvanhorn による — マージされずにクローズ
評価
調査の方向性
Start in NCAutoUpload.swift around autoUploadBackgroundSync at line 376, then trace removeUploadedAssetsIfNeeded and the handling of a successful PROPFIND. Reproduce with existing server photos and remove_photo_CameraRoll enabled; done means those already-present assets are removed from the camera roll without changing the handling of upload errors.
索引モデルが issue の本文から書いたものです。
説明
How to use GitHub
- Please use the 👍 reaction to show that you are affected by the same issue.
- Please don't comment if you have no relevant information to add. It's just extra noise for everyone subscribed to this issue.
- Subscribe to receive notifications on status change and new comments.
Steps to reproduce
- reinstall app with pictures (previously uploaded to the server) still present on the camera roll (for whatever reason, see #4307, #4306 for instance)
- setup app for automatic uploading, "new_photos_only" not set, and "remove_photo_CameraRoll" set
- maintain app in foreground with a good connection (test setup: iPhone and server on the same LAN)
- wait for upload termination
Expected behaviour
I believe these files should be deleted from the camera roll (at least that's the exact reason I reinstalled the app)
Actual behaviour
Out of more than 600 files, only 58 got deleted (including videos that were not uploaded because of #4304 ).
Analysis
When a photo is found in the camera roll, autoUploadBackgroundSync (NCAutoUpload.swift:376) will PROPFIND the server, with 3 outcomes
.errorCode == 404: extract and upload file- other errors (503, 401, 423, ...): do nothing, we'll see on next pass
.success: file exists, deletes the local asset row -> this is where the decision is made to not delete the file
Note: the existence check is only based on the name of the file. In my case, with default _filenamemask_ and _autoupload_create_subfolder_ set, there is a very thin chance this could cause collisions, so it's fine. Perhaps other users may encounter issues -- and perhaps changing this is way too costly..
A remark: a few more logs could help better diagnose the auto-upload system, such as upload successes, photos deletion requests (removeUploadedAssetsIfNeeded), logging getCameraRollAssets filtered vs unfiltered counts, etc.
let unfilteredCount = collections.reduce(0) { $0 + PHAsset.fetchAssets(in: $1, options: nil).count }
nkLog(tag: self.global.logTagBgSync,
message: "getCameraRollAssets: collections=\(collections.count), filteredCount=\(allAssets.count), unfilteredLibraryCount=\(unfilteredCount)",
minimumLogLevel: .verbose)
Logs
issue-existing-photos-not-deleted-1.txt
Reasoning or why should it be changed/implemented?
Like I said, IMHO the app should not make the difference between a file that is already there and one that has just been uploaded, so the setting "remove_photo_CameraRoll" should apply to both. Plus, with current auto-upload issues, that would have given me an workaround to clean my camera roll ;). Right now, though, I can safely clear my camera roll
Environment data
iOS version: iOS 18.7
Nextcloud iOS app version: 35.0.0.8
Server operating system: Nextcloud AIO 14.1.1
Web server: Nextcloud AIO 14.1.1
Database: Nextcloud AIO 14.1.1
PHP version: Nextcloud AIO 14.1.1
Nextcloud version: 34.0.4
- 主要言語
- Swift
- スター
- 2.5k
- フォーク
- 1k
- 平均マージ
- 1日 18時間
- マージ済み PR(30日)
- 25
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
nextcloud/ios のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
Modify action only shown in context menu対応中かも @mpivchev が 15 日前に担当しました。 オープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
nextcloud/ios#4332 · コメント 2 件 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 70/100
メンテナーはふだん 1 日以内に返信
似ている issue
-
enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 61/100
JWhite212/SignalLadder#215 ·
メンテナーはふだん 1 日以内に返信
-
bug javascript
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
-
enhancement mac
難易度 2/5 1〜3時間 初心者へのやさしさ 73/100
-
feat: 앱 정보에 개인정보처리방침과 고객지원 연결対応中かも @xrpjwk8 が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
DeveloperAcademy-POSTECH/2026-C6-A13-Hear-I-am#120 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 79/100
SwiftOldDriver/iOS-Weekly#5492 ·