Repository navigation
fix: stop unchanged analytical rewrites and stabilize Mac service updates #182
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| "@selftune/desktop": patch | ||
| --- | ||
|
|
||
| Preserve unchanged historical metric rollups during source revisions instead of deleting and reinserting the same values and indexes. Keep changed-value corrections, removed points, surviving older observations, and unrelated retained history correct. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| "@selftune/desktop": patch | ||
| --- | ||
|
|
||
| Update the pinned Electron 41 runtime to 41.10.6 for the sandbox, protocol-handler, and webview security fixes identified in the current release review. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| "@selftune/desktop": patch | ||
| --- | ||
|
|
||
| Register the macOS background service from the signed app bundle when SelfTune is installed in Applications. Updating the app no longer moves that service to a new version-specific executable path. Temporary Mac app copies, Windows, and Linux retain the extracted runtime. |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| /** Reconcile only changed values for a revised batch's removed and incoming keys. */ | ||
| export const reconcileRevisedMetricRollups: ReadonlyArray<string> = [ | ||
| `INSERT INTO observability_revised_metric_keys | ||
| SELECT trace_id, metric_name FROM observability_historical_metric_rollup_staging`, | ||
|
Comment on lines
+3
to
+4
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 📐 Maintainability & Code Quality | Add explicit column lists to the positional inserts. Statement 1 inserts into Statement 4 uses List the columns in both inserts. Proposed change
Also applies to: 24-25
|
||
| `CREATE OR REPLACE TEMP TABLE observability_revised_metric_rollups AS | ||
| SELECT trace_id, metric_name, metric_id, source_id, observed_at, value, unit, | ||
| temporality, evidence_quality, source_reference | ||
| FROM observability_retained_metric_candidates AS point | ||
| WHERE EXISTS (SELECT 1 FROM observability_revised_metric_keys AS affected | ||
| WHERE affected.trace_id = point.trace_id AND affected.metric_name = point.metric_name) | ||
| QUALIFY ROW_NUMBER() OVER ( | ||
| PARTITION BY trace_id, metric_name ORDER BY observed_at DESC, metric_id DESC | ||
| ) = 1`, | ||
| `DELETE FROM observability_historical_metric_rollups AS rollup | ||
| WHERE EXISTS (SELECT 1 FROM observability_revised_metric_keys AS affected | ||
| WHERE affected.trace_id = rollup.trace_id AND affected.metric_name = rollup.metric_name) | ||
| AND NOT EXISTS (SELECT 1 FROM observability_revised_metric_rollups AS latest | ||
| WHERE latest.trace_id = rollup.trace_id AND latest.metric_name = rollup.metric_name | ||
| AND latest.metric_id = rollup.metric_id AND latest.source_id = rollup.source_id | ||
| AND latest.observed_at = rollup.observed_at AND latest.value = rollup.value | ||
| AND latest.unit = rollup.unit AND latest.temporality = rollup.temporality | ||
| AND latest.evidence_quality = rollup.evidence_quality | ||
| AND latest.source_reference = rollup.source_reference)`, | ||
| `INSERT INTO observability_historical_metric_rollups | ||
| SELECT * FROM observability_revised_metric_rollups AS latest | ||
| WHERE NOT EXISTS (SELECT 1 FROM observability_historical_metric_rollups AS current | ||
| WHERE current.trace_id = latest.trace_id AND current.metric_name = latest.metric_name)`, | ||
| "DROP TABLE observability_revised_metric_rollups", | ||
| "DROP TABLE observability_revised_metric_keys", | ||
| ]; | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🩺 Stability & Availability |
Minor | ⚡ Quick win
🔎 Supported by static analysis
🏁 Script executed:
Repository: selftune-dev/selftune
Length of output: 6552
🏁 Script executed:
Repository: selftune-dev/selftune
Length of output: 9947
🏁 Script executed:
Repository: selftune-dev/selftune
Length of output: 5767
🏁 Script executed:
Repository: selftune-dev/selftune
Length of output: 1695
Defer
installedRuntimeRoot()until the selector needs it.backgroundServiceOptionsevaluatesinstalledRuntimeRoot()beforebackgroundServiceResourceDirectoryruns. On macOS installs from the Applications folder, the selector ignores that value, but the call still throws whenactiveRuntimeRootis null.activeRuntimeRootstays null untilinstallRuntimeSynccompletes. If runtime installation fails, a later service action, such as a status refresh or restart, can fail with a defect instead of a typed service failure. On Applications installs, this blocks the bundled service path even though the selector would not use the extracted directory. The normal boot path is not affected, becausebootInternalinstalls the runtime before any service call.Suggested fix
Update the two
backgroundServiceResourceDirectorycalls inapps/desktop/src/main/background-service.test.ts(lines 24 and 35) to pass a function.