fix(obslist): post-merge cleanup from PR #394 review (issues #2, #4)#485
Merged
Conversation
The shared ObjectsDatabase handle in object_details.py was documented as "only used when cross-catalog descriptions are enabled" -- but there is no such setting and _other_catalog_descriptions() always runs on the description view. Rewrite the comment to state that it always runs and to document the connection lifecycle (lives for the UI process, like the per-instance ObservationsDatabase, released at process exit). No behaviour change; the feature stays always-on (per-object query is a single indexed lookup, skipped entirely for virtual planets/comets/OBS objects). Post-merge cleanup from the review of PR #394 (issue #2). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…ash the UI read_list only wrapped the file read in try/except; the resolution loop (resolve_object / _build_name_index / resolve_by_name / _coordinate_object) was unprotected. A DB error, uninitialised catalogs, or a malformed entry propagated to UIObsList.key_right, which has no handler -- crashing the UI instead of showing the existing "Error loading" message. - Per-entry guard: one malformed entry is logged and skipped, and the rest of the list still loads (result stays "success", matched < parsed). - Systemic failure (every entry raises, e.g. catalog DB unavailable) is reported as the error dict instead of a silent "0 objects" success. - Outer safety net mirrors the file-read error-dict contract for any failure outside the per-entry guard; it counts len(list_catalog) so it can't re-raise on the same broken `entries`. Return shape is unchanged, so UIObsList.key_right works without modification. Adds unit tests for all three paths (per-entry skip, systemic error, outer net). Post-merge cleanup from the review of PR #394 (issue #4). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two deferred follow-up fixes from the review of #394
(
feat: multi-format observing list import with native .pifinder support).Both are low-risk and independent; neither was a merge blocker.
#2 — Cross-catalog description query comment (
ui/object_details.py)The shared
ObjectsDatabasehandle was documented as "only used whencross-catalog descriptions are enabled" — but no such setting exists and
_other_catalog_descriptions()runs unconditionally on the description view.Resolution: keep the feature always-on and fix the comment (the product
call). The per-object query is a single indexed lookup and returns
{}forvirtual planets/comets/
OBScoordinate objects, so the cost is negligible.The comment now also documents the connection lifecycle: the read handle lives
for the UI process and is released at process exit, matching the existing
per-instance
ObservationsDatabasein the same file. No behaviour change.#4 —
read_listresolution loop could crash the UI (obslist.py)read_listonly wrapped the file read in try/except; the resolution loop wasunprotected, so a DB error, uninitialised catalogs, or a malformed entry
propagated to
UIObsList.key_right(no handler) and crashed the UI instead ofshowing the existing "Error loading" message.
the list still loads (
resultstays"success",matched < parsed).returned as the error dict instead of a silent "0 objects" success.
failure outside the per-entry guard, counting
len(list_catalog)so itcan't re-raise on the same broken
entries.Return shape is unchanged, so
UIObsList.key_rightworks without modification.Tests
Adds
TestReadListErrorHandlingtotests/test_obslist_resolve.py(unitmarker) covering all three paths: per-entry skip, systemic error, and the
outer net.
ruff check(withbuiltins=['_']) andruff format --checkclean on allchanged files.
Out of scope (documented in #394's review thread): #1 real-file fixtures,
#3 session-wide description accumulation (ADR-0011), and nits #5/#6.
🤖 Generated with Claude Code