Skip to content

fix: treat empty repository directory as uninitialized - #3219

Open
jexjws wants to merge 2 commits into
ipfs:mainfrom
jexjws:fix/empty-repo-verification
Open

jexjws wants to merge 2 commits into
ipfs:mainfrom
jexjws:fix/empty-repo-verification

Conversation

@jexjws

@jexjws jexjws commented Sep 20, 2026

Copy link
Copy Markdown

This PR is motivated by ongoing work on the IPFS Desktop Flatpak package for #3042. To reuse the host Kubo repository without granting full home directory access, the Flatpak manifest utilizes --filesystem=~/.ipfs:create. This causes Flatpak to automatically pre-create an empty ~/.ipfs directory on a fresh machine prior to app launch, directly triggering this false-positive "configuration is missing" alert.

When an empty repository directory already exists (such as when pre-created by Flatpak '--filesystem=~/.ipfs:create', user mkdir, or mount points), checkRepositoryAndConfiguration would falsely treat it as a damaged repo missing its config and prompt a warning dialog before initializing it.

Skip verification if the directory is empty or only contains common OS metadata files, allowing ipfsd.init() to proceed as a clean install.

When an empty repository directory already exists (such as when pre-created
by Flatpak '--filesystem=~/.ipfs:create', user mkdir, or mount points),
checkRepositoryAndConfiguration would falsely treat it as a damaged repo
missing its config and prompt a warning dialog before initializing it.

Skip verification if the directory is empty or only contains common OS
metadata files, allowing ipfsd.init() to proceed as a clean install.
@jexjws
jexjws requested a review from a team as a code owner September 20, 2026 08:52
@welcome

welcome Bot commented Sep 20, 2026

Copy link
Copy Markdown

Thank you for submitting this PR!
A maintainer will be here shortly to review it.
We are super grateful, but we are also overloaded! Help us by making sure that:

  • The context for this PR is clear, with relevant discussion, decisions
    and stakeholders linked/mentioned.

  • Your contribution itself is clear (code comments, self-review for the
    rest) and in its best form. Follow the code contribution
    guidelines

    if they apply.

Getting other community members to do a review would be great help too on complex PRs (you can ask in the chats/forums). If you are unsure about something, just leave us a comment.
Next steps:

  • A maintainer will triage and assign priority to this PR, commenting on
    any missing things and potentially assigning a reviewer for high
    priority items.

  • The PR gets reviews, discussed and approvals as needed.

  • The PR is merged by maintainers when it has been approved and comments addressed.

We currently aim to provide initial feedback/triaging on best-effort basis, which may take multiple business. Please keep an eye on any labelling actions, as these will indicate priorities and status of your contribution.
We are very grateful for your contribution!

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.

1 participant