Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,46 @@ Format follows [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

---

## [1.19.2] — 2026-09-16

> Bugfix-only release on the 1.19.0 stable line, following directly on
> from v1.19.1. Adds a safety net for the macOS #825/#867 migration, plus
> diagnostic logging to help track down a still-open, related report.

### Fixed

- **macOS: permanent in-place backup of `opensak.json` before the #825
migration touches anything (fixes #870)** — A real user (Mike Wood)
reported that his settings file (`opensak.json`) — username, home
coordinates, everything — disappeared entirely after upgrading on
macOS, despite the file-move logic itself behaving correctly when
traced step by step. The exact cause of the disappearance is still
under investigation, but regardless of that cause, there was no reason
a user should ever need a system backup to recover: the migration
already has the original file in hand for a moment before doing
anything to it. It now leaves a permanent copy
(`opensak.json.pre-825-migration-backup`) behind, in place, in the old
directory — explicitly excluded from the move/cleanup logic so it can
never be swept away by the same process, or by anything that happens
afterward. Previously, recovering from this required a Time Machine
(or similar) backup of a hidden path most backup tools don't cover by
default; this user was only able to recover in full because he
happened to have one.

### Added

- **Diagnostic logging for the macOS migration and database-manager
fallback (#870)** — Two new debug-log channels (`settings_migration`,
`db_manager`), enabled by default for now, trace exactly what the
#825/#867 migration finds and does at each step, and log a clear
warning at the precise moment `DatabaseManager` falls back to creating
a fresh, empty "Default" database because it couldn't find any
database it recognised. If this happens to you, `opensak.log` will now
show what your settings actually contained right before that point —
please attach it if you report a similar issue.

---

## [1.19.1] — 2026-09-15

> Bugfix-only release on the 1.19.0 stable line. Fixes a data-loss-looking
Expand Down
Binary file modified site/assets/screenshots/main-window.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified site/assets/screenshots/map-maximized.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified site/assets/screenshots/map-popout.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 5 additions & 5 deletions site/user-guide.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>OpenSAK User Guide — v1.19.1</title>
<title>OpenSAK User Guide — v1.19.2</title>
<style>
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@700&family=Source+Serif+4:ital,wght@0,300;0,400;0,600;1,400&family=JetBrains+Mono:wght@400;500&display=swap');

Expand Down Expand Up @@ -473,7 +473,7 @@
<nav>
<div class="nav-header">
<span class="nav-logo">OpenSAK</span>
<div class="nav-version">User Guide · v1.19.1</div>
<div class="nav-version">User Guide · v1.19.2</div>
</div>

<div class="nav-section-heading">Getting Started</div>
Expand Down Expand Up @@ -535,7 +535,7 @@
<div class="hero-eyebrow">Complete User Guide</div>
<h1>OpenSAK</h1>
<p class="hero-sub">The open-source geocache management tool for Windows, Linux, and macOS.</p>
<div class="hero-meta">Version 1.19.1 &nbsp;·&nbsp; MIT Licence &nbsp;·&nbsp; <a href="https://github.com/OpenSAK-Org/opensak">github.com/OpenSAK-Org/opensak</a></div>
<div class="hero-meta">Version 1.19.2 &nbsp;·&nbsp; MIT Licence &nbsp;·&nbsp; <a href="https://github.com/OpenSAK-Org/opensak">github.com/OpenSAK-Org/opensak</a></div>
</div>

<figure class="screenshot" style="margin-top:-0.5rem;">
Expand Down Expand Up @@ -1463,7 +1463,7 @@ <h3>Debug Log</h3>
<tr><td>Bug reports &amp; feature requests</td><td><a href="https://github.com/OpenSAK-Org/opensak/issues">github.com/OpenSAK-Org/opensak/issues</a></td></tr>
<tr><td>Community discussion</td><td><a href="https://www.facebook.com/groups/opensak">Facebook group: OpenSAK</a></td></tr>
<tr><td>Releases &amp; downloads</td><td><a href="https://github.com/OpenSAK-Org/opensak/releases">github.com/OpenSAK-Org/opensak/releases</a></td></tr>
<tr><td>Changelog</td><td><a href="https://github.com/OpenSAK-Org/opensak/blob/v1.19.1/CHANGELOG.md">CHANGELOG.md on GitHub</a></td></tr>
<tr><td>Changelog</td><td><a href="https://github.com/OpenSAK-Org/opensak/blob/v1.19.2/CHANGELOG.md">CHANGELOG.md on GitHub</a></td></tr>
<tr><td>Contributing</td><td><a href="https://github.com/OpenSAK-Org/opensak/blob/main/CONTRIBUTING.md">CONTRIBUTING.md on GitHub</a></td></tr>
<tr><td>Support the project</td><td><a href="https://opencollective.com/opensak">opencollective.com/opensak</a></td></tr>
<tr><td>Website</td><td><a href="https://opensak.com">opensak.com</a></td></tr>
Expand All @@ -1473,7 +1473,7 @@ <h3>Debug Log</h3>
<div class="callout tip"><div class="callout-icon">💡</div><div>OpenSAK is free and open-source software released under the MIT licence. Contributions of any kind — code, translations, documentation, or testing — are very welcome.</div></div>

<p style="margin-top:2rem;color:var(--ink-light);font-size:0.85rem;font-style:italic;">
This guide was generated from the OpenSAK source code (v1.19.1). Last updated August 2026.
This guide was generated from the OpenSAK source code (v1.19.2). Last updated August 2026.
</p>
</section>

Expand Down
2 changes: 1 addition & 1 deletion src/opensak/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""OpenSAK — cross-platform geocache management tool."""
__version__ = "1.19.1"
__version__ = "1.19.2"
__author__ = "OpenSAK Contributors"
__license__ = "MIT"
37 changes: 36 additions & 1 deletion src/opensak/db/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,13 @@

logger = logging.getLogger(__name__)

# Issue #870: detaljeret sporing af hvad der reelt indlæses fra settings.
# Tavs medmindre "db_manager"-flaget er aktivt i debug_flags.py. De
# ovenstående logger.warning()-kald forbliver altid synlige uanset flag.
from opensak.logger import get_logger

_debug_log = get_logger("db_manager")

_SQLITE_MAGIC = b"SQLite format 3\x00"


Expand Down Expand Up @@ -137,21 +144,36 @@ def _load_from_settings(self) -> None:
"""Indlæs liste over kendte databaser fra opensak.json."""
store = get_store()
db_list = store.get("databases.list", [])
raw_active_path = store.get("databases.active")
_debug_log.debug(
"_load_from_settings: databases.list=%r, databases.active=%r, "
"databases.dir=%r",
db_list, raw_active_path, store.get("databases.dir"),
)
if isinstance(db_list, list):
for entry in db_list:
if isinstance(entry, dict):
name = entry.get("name")
path = entry.get("path")
if name and path:
migrated = self._migrate_path(Path(path))
_debug_log.debug(
"_load_from_settings: database %r -> %s "
"(oprindelig sti %r, findes på disk: %s)",
name, migrated, path, migrated.exists(),
)
info = DatabaseInfo(name, migrated)
self._databases.append(info)

# Aktiv database
active_path = store.get("databases.active")
active_path = raw_active_path
if active_path:
migrated_active = self._migrate_path(Path(active_path))
found = self._find_by_path(migrated_active)
_debug_log.debug(
"_load_from_settings: aktiv sti %r -> %s, matchede en kendt "
"database: %s", active_path, migrated_active, found is not None,
)
if found:
self._active = found

Expand All @@ -161,12 +183,25 @@ def _load_from_settings(self) -> None:
# Hvis ingen databaser kendes, opret Default
if not self._databases:
default_path = self._default_db_path()
logger.warning(
"Ingen kendte databaser fundet i settings (databases.list var "
"%r, databases.active var %r) — opretter en frisk, tom "
"'Default'-database på %s. Hvis brugeren forventede en "
"eksisterende database, ligger den sandsynligvis stadig "
"urørt et andet sted på disken (se issue #870).",
db_list, raw_active_path, default_path,
)
default = DatabaseInfo("Default", default_path)
self._databases.append(default)
self._active = default
self._save_to_settings()
elif self._active is None:
# Databaser kendes men ingen aktiv — brug den første
_debug_log.debug(
"_load_from_settings: %d database(r) kendt, men ingen aktiv "
"— bruger den første: %r", len(self._databases),
self._databases[0].name,
)
self._active = self._databases[0]
self._save_to_settings()

Expand Down
14 changes: 8 additions & 6 deletions src/opensak/debug_flags.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,14 @@
# Hvert modul der ønsker debug-logging skal have en nøgle her.
# Nøglen bruges som logger-navn: logging.getLogger(f"opensak.{key}")
DEBUG_MODULES: dict[str, bool] = {
"updater": True, # update checker — aktiveret for #204
"importer": False, # GPX/PQ import
"filter_engine": False, # filter beregning
"map_widget": False, # Leaflet/kort
"database": False, # SQLAlchemy queries
"geo": False, # reverse geocoding (boundaries, packs, store)
"updater": True, # update checker — aktiveret for #204
"importer": False, # GPX/PQ import
"filter_engine": False, # filter beregning
"map_widget": False, # Leaflet/kort
"database": False, # SQLAlchemy queries
"geo": False, # reverse geocoding (boundaries, packs, store)
"settings_migration": True, # macOS #825/#867/#870-migration — aktiveret indtil #870's rodårsag er fundet
"db_manager": True, # DatabaseManager load/fallback-diagnostik — aktiveret indtil #870's rodårsag er fundet
}


Expand Down
Loading