Skip to content

Verify and repair restores local source_kind content #7596

Description

@SalmonSnaked
  • I checked the existing issues for duplicate problems
  • I have ensured my Modrinth App installation is up to date; v0.21.4 on Windows

The root problem

This issue is part of a series of problems caused by the database marking externally removed files as "missing".


The flaw with verify and repair

It would make sense if Verify and Repair managed ModrinthModpack, ServerProject, ModrinthHosting, ImportedModpack, and SharedInstance source kinds. But for non-shared and non-managed Local content, it would only get in the way of users who externally manage content.

verify-and-repair.mp4
  1. The database noticed that Fabric API was removed externally (not through the App UI) and therefore marks it as missing.
  2. When I go to verify and repair, it restores the mod I deliberately removed because it was "missing".

Possible solutions

1. Give each `source_kind` a repair policy (core fix)
Source kind File missing File hash differs
ModrinthModpack, ServerProject, ModrinthHosting, ImportedModpack, SharedInstance Restore Repair
SharedContent (for hardlinked content in the future) No action Repair
Local No action No action
  • Managed kinds have an external definition of desired state. For Local content, desired state is whatever is on disk.
2. Treat the disk as truth for Local rows
  • When an external delete is detected for a Local entry, drop its instance_content_entries and instance_files rows instead of flagging it as missing. Run the same reconciliation at the start of Verify and Repair and on the instance refresh button. A one-time migration can clear Local rows currently flagged as missing.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    appRelates to Modrinth App

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions