Rebase: a field update of a row deleted in the database is dropped without any record; and the conflicts file is per project, not per connection

Offen
#195 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

@NicklasBlidmo arbeitet bereits daran.

Seit 27.10.2026.

  • #196 von @NicklasBlidmo — offen

Bewertung

Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Anfängerfreundlichkeit
48/100
Issue-Typ
Bug
Klarheit
Größtenteils klar
Aktivitätsstatus
Aktiv
Tech-Stack
postgresql, python
Bereich
backend, database

Rechercherichtung

Start by tracing pull() and the rebase handling described in the issue, especially _handle_delete, then inspect how conflict and base2our/base2their filenames are built. Reproduce the delete-versus-update case and a cycle with multiple connections. Done means lost field updates are recorded and each connection's conflict and rebase files retain distinct names.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

We ran the concurrent-edit cases of a two-way setup (db-sync 2.4.0,
geodiff 2.3.0, PostgreSQL driver, one GeoPackage, edits in the database
by SQL and in the field through the QGIS plugin, the daemon paused to
create the window). Outcomes:

database field result record
update column B update column A, same row both values on both sides —
update value D update same column, value F D on both sides (the database syncs last and wins) conflicts file, old = F, new = D
update row delete row row gone on both sides, the update dropped conflicts file (entry without old)
delete row update row row gone on both sides, the field's update lost nothing

Two things we would like to change:

  1. The last case leaves no record. geodiff rebase-db keeps our
    delete over their update (consistent with "a delete wins", fine) but
    writes nothing to the conflicts file for it, so the field crew's edit
    disappears without a trace: not in the database, not in the file, not
    in the log. The information is available in pull() before the
    rebase: base2our (computed before mc.pull_project) holds our
    delete, base2their (computed after) holds their update. Matching the
    two by row key and logging one WARNING per lost update is a small
    change in db-sync; PR follows. Recording it in the conflicts file
    instead would be a geodiff change (the rebase's _handle_delete
    records only the opposite direction), which we can propose there if
    you prefer.

  2. The conflicts file is named per project:
    <tmp>/<project name>-dbsync-pull-conflicts. With several connections
    (several GeoPackages of one project, which 2.4.0 supports with one
    working directory per connection), a second rebase in the same cycle
    overwrites the first connection's file before anyone can read it.
    Naming it <project name>-<modified schema>-dbsync-pull-conflicts,
    like the working directory, keeps every connection's record. We read
    these files (dbsync-manager keeps them and shows them per project), so
    the name matters to us; the same goes for -dbsync-pull-base2our /
    -base2their.

Vorherrschende Sprache
Python
Sterne
55
Forks
25
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Entwicklungsumgebung

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus MerginMaps/db-sync

Alle Issues in MerginMaps/db-sync

Ähnliche Issues

Weitere Issues zu Python

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.