MerginMaps / MerginMaps/db-sync

Init: possible confusion if base+modified schemas already exist but local project dir doesn't

Open
#175 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Python
Stars
53
Forks
24
PR merge metrics
No merged PRs in 30d

Description

Seen the following case:

  • configuration file "base" and "modified" schemas already exist in the database
  • the project directory does not exist yet

In this scenario, db-sync will download the MM project at a particular version, but it does not check project ID first. This is a potential problem, because db-sync may try to download a project that is incompatible with the data already stored in the database - this can result in trying to fetch project at e.g. version 1234, but project may not even exist in such version, so the project download will fail.

The fix should be to check project ID before project's download, and fail with error if they do not match.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Inspect the initialization flow where db-sync downloads the Mergin Maps project, and trace how the existing base and modified schemas are read from the database. Check the project ID before downloading; done means an incompatible ID produces an error instead of attempting the download.

Written by the indexing model from the issue text.

Assessment

Tech stack
postgresql, python
Domain
databases
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
50/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.