Skip to content

[PB-5921]: File Provider folder browsing (read-only enumeration)#492

Merged
terrerox merged 3 commits into
release-1.9.1from
feature/pb-5920-file-provider-folder-browsing
Jul 8, 2026
Merged

[PB-5921]: File Provider folder browsing (read-only enumeration)#492
terrerox merged 3 commits into
release-1.9.1from
feature/pb-5920-file-provider-folder-browsing

Conversation

@terrerox

@terrerox terrerox commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Implements read-only browsing of Drive in the iOS Files.app via the InternxtFileProvider extension.

What this delivers

  • Root + subfolder enumeration — lists folders and files from the Drive API
    and navigates into subfolders.
  • Correct namesplainName + extension.
  • Pagination — 50 items/page via NSFileProviderPage as the cursor
    (folders first, then files, plainName ASC), so large folders show all items.
  • Item metadata — size, creation/modification dates, and per-kind
    materialization flags so items render as normal cloud items (folders
    materialized; files cloud-downloadable) instead of greyed/locked placeholders.
  • Auth/offline states — missing credentials → notAuthenticated
    (drives the system "Sign in to Internxt Drive" prompt); network errors
    surface as errors without crashing.
  • Drive API wiringDriveAPIFactory builds an authenticated client from
    the shared App Group keychain; adds a shared driveBaseUrl key.
  • Type-prefixed item identifiers (f:/d:) so a container identifier
    round-tripped by Files.app resolves back to a Drive folder uuid.

terrerox added 2 commits June 11, 2026 22:06
The File Provider extension needs the Drive API base URL to build
authenticated requests from the App Group keychain. Add a dedicated
shared key so it can be read alongside the existing auth token.
Replace the placeholder enumerator with real Drive folder browsing:
paginate folders then files for a container, build FileProviderItem
metadata (name, type, size, dates, capabilities) from Drive responses,
and resolve identifiers via a typed folder/file id codec. Add a
DriveAPIFactory that constructs an authenticated DriveAPI from the
shared App Group keychain, and wire the new sources into the
extension target.
@terrerox terrerox force-pushed the feature/pb-5920-file-provider-folder-browsing branch from 4fcdcfd to f222339 Compare June 12, 2026 02:40
@terrerox terrerox changed the title Feature/pb 5920 file provider folder browsing [PB-5921]: File Provider folder browsing (read-only enumeration) Jun 12, 2026
@terrerox terrerox self-assigned this Jun 12, 2026
Base automatically changed from feature/pb-5920-file-provider-domain-registration to release-1.9.1 June 19, 2026 05:06
Comment on lines +178 to +191
private static let iso8601Formatter: ISO8601DateFormatter = {
let formatter = ISO8601DateFormatter()
formatter.formatOptions = [.withInternetDateTime, .withFractionalSeconds]
return formatter
}()

private static func parseISO8601(_ value: String?) -> Date? {
guard let value = value, !value.isEmpty else { return nil }
if let date = iso8601Formatter.date(from: value) {
return date
}
let fallback = ISO8601DateFormatter()
fallback.formatOptions = [.withInternetDateTime]
return fallback.date(from: value)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think that fallback creates a new ISO8601DateFormatter on every call, and this is executed for each item in the enumeration. Cache it as a static let, just like iso8601Formatter above, do not mutate an instance shared between the two formats because it is called from concurrent Task {} in the enumerator.
Also, I would rename parseISO8601 to parseDate

@terrerox terrerox requested a review from CandelR July 6, 2026 15:38
@sonarqubecloud

sonarqubecloud Bot commented Jul 6, 2026

Copy link
Copy Markdown

@terrerox terrerox merged commit ef0f11c into release-1.9.1 Jul 8, 2026
2 of 3 checks passed
@terrerox terrerox deleted the feature/pb-5920-file-provider-folder-browsing branch July 8, 2026 22:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants