Skip to content

fix: skip an unopenable database in usageapps instead of crashing - #1117

Merged
abrignoni merged 1 commit into
mainfrom
fix/usageapps-none-guard
Aug 14, 2026
Merged

fix: skip an unopenable database in usageapps instead of crashing#1117
abrignoni merged 1 commit into
mainfrom
fix/usageapps-none-guard

Conversation

@abrignoni

Copy link
Copy Markdown
Owner

What

get_usageapps did db = open_sqlite_db_readonly(file_found) and then db.cursor() with no
None check. open_sqlite_db_readonly returns None (and logs why) when the database cannot
be opened, so an unreadable reflection_gel_events.db raised AttributeError. The main loop
catches it as "Reading ... artifact had errors!" and the artifact loses its rows.

Guard the None and skip the file, identical to the fix siminfo already carries (#1111).

Why just this one

This is the leaf follow-up to the Windows long-path fix (#1113). An audit found 315 direct
open_sqlite_db_readonly call sites across the cores that use the result without a None
check, but per fix-what-fails only siminfo was ever observed failing, and that cause
(a >260-char path making the open return None) is now fixed at the source in #1113.
usageapps is siminfo's exact twin, the only other artifact that normalises the path to
forward slashes before opening, so it gets the same guard. The remaining sites are
reachable-but-unobserved and are left for opportunistic guarding when each artifact is next
touched.

Testing

  • The audit checker no longer flags usageapps after the change.
  • pylint 10.00/10, module imports.

open_sqlite_db_readonly returns None when the database cannot be opened,
and get_usageapps called db.cursor() on it without checking, so an
unreadable reflection_gel_events.db raised AttributeError and the main
loop lost the artifact's rows. Guard the None the same way siminfo does
(#1111): skip the file and move on.

usageapps is the twin of siminfo, the only other artifact that normalises
the path to forward slashes before opening it. This is the leaf half of
the Windows long-path work; the URI double-prefix that made the open
return None on a path over 260 characters was fixed in #1113.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@abrignoni
abrignoni merged commit b3533b9 into main Aug 14, 2026
8 checks passed
@abrignoni
abrignoni deleted the fix/usageapps-none-guard branch August 14, 2026 23:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant