Skip to content

Replace UNIX Sockets with XPC #9430

Description

@i2h3

As discussed months ago internally in the desktop team, it would be beneficial in several ways to consolidate the interprocess communication on macOS between main app and its extensions (FinderSyncExt, FileProviderExt and FileProviderUIExt). Currently, we also utilize UNIX socket files with custom implementations for message sending and receiving in addition to the standard XPC way on macOS.

  • The UNIX sockets add unnecessary code to maintain the low-level implementation which we do not have with XPC
  • The UNIX sockets are limited in their file path length which is a foreseeable problem with branded builds using long identifiers which will ultimately break them
  • With XPC as the conventional first-party solution on the other hand we have unnecessary redundancy based on a different technology

Goals

  • Exclusively on macOS, replace all socket messages with an equivalent Objective-C method call via XPC.
  • Socket communication for the other platforms, if existing, should be left untouched. This is specific to macOS builds.

Context

  • shell_integration/MacOSX/NextcloudIntegration/FileProviderExt/FileProviderSocketLineProcessor.swift implements the endpoint on the file provider extension side for the UNIX socket communication. This should no longer exist in the end.
  • shell_integration/MacOSX/NextcloudIntegration/FinderSyncExt/FinderSyncSocketLineProcessor.h and its implementation file implement the endpoint for the FinderSync extension side of the UNIX socket communication. This should no longer exist in the end.
  • src/gui/macOS/AppProtocol.h for the XPC service exposed by the main app.
  • src/gui/macOS/ClientCommunicationProtocol.h for the XPC service exposed by the file provider extension.
  • src/gui/macOS/fileprovidersocket* files and their implementation counterparts should be obsolete and removed in the end. The features provided by these should be implemented in src/gui/macOS/fileproviderxpc.h and related files as XPC calls.
  • src/gui/socketapi/socketapi_mac.mm should be obsolete and removed in the end.

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions