Disabling Flatpak's ephemeral file system

There is a behavior in Flatpak that hurts UX.

Apps that don’t use file portals seem to be given a “virtual” file system to write files to. The app is getting a success code on file writes, even though the success only happened on that “virtual” file system and there is no change on the user’s machines.

The content of that “virtual” file system are lost on app restart.

Is there a way to disable this behavior so that the app gets an error code instead of a success code when trying to write files to locations it is not allowed to write to?

The virtual file system is a core part of Flatpak, as it provides a clear separation between the system and the app environment. This is needed for the sandbox, but also to ensure interoperability.

The data folder for an app, found under ~/.var/app/$APPID/, is an valid place to write data to. Otherwise, you need to add additional mounts using the --filesystem argument.
Though the ideal case would be if the app would adopt the Documents and FileChooser portal to request file access from the system.

See this comment for discussion on this issue:

1 Like