-
Notifications
You must be signed in to change notification settings - Fork 6
Add more logging to the V1 file uploader #245
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Couple questions/concerns
SwiftPackage/Sources/BridgeClientExtension/File Uploading/V1/BridgeFileUploadManager.swift
Outdated
Show resolved
Hide resolved
let fullPath = self.fullyQualifiedPath(of: filePath) | ||
guard FileManager.default.fileExists(atPath: fullPath) else { | ||
let message = "Unexpected: Attempting to retrieve upload API info for temp file with invariant path '\(filePath) but temp file does not exist at '\(fullPath)" | ||
throw BridgeUnexpectedNullError(category: .missingFile, message: message) | ||
} | ||
let tempFile = URL(fileURLWithPath: fullPath) | ||
let attributes = try? FileManager.default.attributesOfItem(atPath: fullPath) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not 100% certain, but I don't think this gets extended attributes, if that's what you were hoping to log. There's a completely separate api for xattrs. IIRC there's a class extension somewhere that implements this since I think xattrs api is Obj-C only.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah, I'm looking for the attributes like "when was the file last modified/created" rather than the extended attributes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah ok makes sense
a5d68f8
to
969b5c9
Compare
This was trying to process files that were being stored by the app in app support at the base directory.
Crashlytics is reporting that the V1 uploader is attempting to repeatedly upload an orphaned file with no attributes.
The device in question successfully uploaded the three files, but it looks like they were left behind and not deleted. I'm adding some additional logging to see if there is some pattern I can use to successfully mark the files as uploaded and delete them.
I figured out that files were being stored in the base directory of the "Application Support" directory and the uploader was counting those as orphaned files rather than skipping them.