Skip to content

Commit 035dbf4

Browse files
Merge branch 'main' into dependabot/npm_and_yarn/main/eslint/js-10.0.1
2 parents d70f2dc + b485b71 commit 035dbf4

10 files changed

Lines changed: 80 additions & 27 deletions

File tree

.github/workflows/ci-cd-backend.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,13 @@ jobs:
1818
name: Install & pytest
1919
runs-on: ubuntu-latest
2020
steps:
21-
- uses: actions/checkout@v4
21+
- uses: actions/checkout@v6
2222
with:
2323
submodules: recursive
24-
- uses: actions/setup-python@v5
24+
- uses: actions/setup-python@v6
2525
with:
2626
python-version: '3.12'
27-
- uses: astral-sh/setup-uv@v5
27+
- uses: astral-sh/setup-uv@v7
2828
- name: Install dependencies
2929
working-directory: Backend
3030
run: uv sync

.github/workflows/ci-cd.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,15 @@ jobs:
1919
name: Install dependencies
2020
runs-on: ubuntu-latest
2121
steps:
22-
- uses: actions/checkout@v4
22+
- uses: actions/checkout@v6
2323
with:
2424
submodules: recursive
25-
- uses: actions/setup-node@v4
25+
- uses: actions/setup-node@v6
2626
with:
2727
node-version: '20'
2828
cache: npm
2929
- run: npm ci
30-
- uses: actions/cache@v4
30+
- uses: actions/cache@v5
3131
with:
3232
path: node_modules
3333
key: ${{ runner.os }}-node-${{ hashFiles('package-lock.json') }}
@@ -37,12 +37,12 @@ jobs:
3737
needs: [install]
3838
runs-on: ubuntu-latest
3939
steps:
40-
- uses: actions/checkout@v4
41-
- uses: actions/setup-node@v4
40+
- uses: actions/checkout@v6
41+
- uses: actions/setup-node@v6
4242
with:
4343
node-version: '20'
4444
cache: npm
45-
- uses: actions/cache@v4
45+
- uses: actions/cache@v5
4646
with:
4747
path: node_modules
4848
key: ${{ runner.os }}-node-${{ hashFiles('package-lock.json') }}

.github/workflows/daily-repo-status.lock.yml

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.github/workflows/dependency-review.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,5 @@ jobs:
2424
fail-on-severity: high
2525
# Comment on the PR with a summary of changes
2626
comment-summary-in-pr: always
27-
# Deny copyleft licenses incompatible with the project's proprietary distribution
28-
deny-licenses: GPL-2.0-only, GPL-3.0-only, AGPL-3.0-only
27+
# Retry if snapshots are not immediately available
28+
retry-on-snapshot-warnings: true
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Dependency Submission
2+
3+
on:
4+
push:
5+
branches: [main, develop]
6+
pull_request:
7+
branches: [main, develop]
8+
9+
permissions:
10+
contents: write
11+
12+
jobs:
13+
dependency-submission:
14+
name: Submit Dependency Snapshot
15+
runs-on: ubuntu-latest
16+
17+
steps:
18+
- name: Checkout code
19+
uses: actions/checkout@v6
20+
21+
- name: Setup Node.js
22+
uses: actions/setup-node@v6
23+
with:
24+
node-version: '20'
25+
cache: 'npm'
26+
27+
- name: Submit npm dependency snapshot
28+
uses: actions/npm-dependency-submission-action@v1

.github/workflows/pr-gate.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,10 +94,10 @@ jobs:
9494
- uses: actions/checkout@v6
9595
with:
9696
submodules: recursive
97-
- uses: actions/setup-python@v5
97+
- uses: actions/setup-python@v6
9898
with:
9999
python-version: '3.12'
100-
- uses: astral-sh/setup-uv@v5
100+
- uses: astral-sh/setup-uv@v7
101101
- name: Install backend dependencies
102102
working-directory: Backend
103103
run: uv sync

CHANGELOG.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,18 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
66

77
---
88

9+
## [Unreleased]
10+
11+
### Fixed
12+
13+
- Catch `shutdownValkey()` failures inside `createValkeyClient()` so a broken `quit()` cannot prevent reinitialization or fallback to in-memory rate limiting ([TAS-48](https://linear.app/tasteslikegood/issue/TAS-48/catch-quit-failures-before-reinitializing-valkey-client))
14+
15+
### Changed
16+
17+
- Mark all `inject()` service references as `readonly` across Angular components and services ([TAS-2707](https://linear.app/tasteslikegood/issue/TAS-2707/find-a-small-improvement-copy))
18+
- Use `Number.parseInt()` instead of global `parseInt()` in `server/valkey.ts` for consistency with the rest of the codebase
19+
- Add descriptive context to bare `console.error()` in recipe import error handler
20+
921
## [0.1.0] - 2026-04-13
1022

1123
### Added

server/valkey.ts

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,11 @@ export async function createValkeyClient(): Promise<Redis | null> {
7474
// removed, tear it down to avoid leaking handles (e.g. in tests / dev).
7575
if (client) {
7676
console.warn('[Valkey] VALKEY_HOST removed — shutting down existing client');
77-
await shutdownValkey();
77+
try {
78+
await shutdownValkey();
79+
} catch (err) {
80+
console.error('[Valkey] Shutdown failed during cleanup:', (err as Error).message);
81+
}
7882
}
7983
console.log('[Valkey] VALKEY_HOST not set — using in-memory rate limiting');
8084
return null;
@@ -86,13 +90,18 @@ export async function createValkeyClient(): Promise<Redis | null> {
8690
await client.ping();
8791
return client;
8892
} catch {
89-
// Existing client is unhealthy — tear it down before reinitializing
93+
// Existing client is unhealthy — tear it down before reinitializing.
94+
// Catch shutdown errors so a broken quit() cannot prevent reinitialization.
9095
console.warn('[Valkey] Existing client unhealthy, reinitializing...');
91-
await shutdownValkey();
96+
try {
97+
await shutdownValkey();
98+
} catch (err) {
99+
console.error('[Valkey] Shutdown failed during reinit:', (err as Error).message);
100+
}
92101
}
93102
}
94103

95-
const port = parseInt(process.env.VALKEY_PORT || '6379', 10);
104+
const port = Number.parseInt(process.env.VALKEY_PORT || '6379', 10);
96105
const authMode = process.env.VALKEY_AUTH_MODE;
97106

98107
try {
@@ -149,7 +158,11 @@ export async function createValkeyClient(): Promise<Redis | null> {
149158
return client;
150159
} catch (err) {
151160
console.error('[Valkey] Connection failed, falling back to in-memory rate limiting:', err);
152-
await shutdownValkey();
161+
try {
162+
await shutdownValkey();
163+
} catch (shutdownErr) {
164+
console.error('[Valkey] Shutdown failed during fallback:', (shutdownErr as Error).message);
165+
}
153166
return null;
154167
}
155168
}

src/app.component.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ import { Ingredient, IngredientGroup, Recipe } from './recipe.types';
1414
styleUrls: [],
1515
})
1616
export class AppComponent {
17-
private geminiService = inject(GeminiService);
18-
private persistenceService = inject(PersistenceService);
19-
authService = inject(AuthService);
17+
private readonly geminiService = inject(GeminiService);
18+
private readonly persistenceService = inject(PersistenceService);
19+
readonly authService = inject(AuthService);
2020

2121
// Navigation
2222
activeView = signal<'generator' | 'kitchen'>('generator');
@@ -392,7 +392,7 @@ export class AppComponent {
392392
alert(`Successfully imported ${count} recipes!`);
393393
}
394394
} catch (err) {
395-
console.error(err);
395+
console.error('Failed to parse recipe import file:', err);
396396
alert('Failed to parse recipe file. Please ensure it is valid JSON.');
397397
}
398398
};

src/services/persistence.service.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import { Cookbook } from '../auth.types';
2020
export class PersistenceService {
2121
/** Prevents duplicate API loads for the same session. */
2222
private _apiSynced = false;
23-
private auth = inject(AuthService);
23+
private readonly auth = inject(AuthService);
2424

2525
constructor() {
2626
// Auto-load from API when a logged-in user's session is confirmed.

0 commit comments

Comments
 (0)