-
Notifications
You must be signed in to change notification settings - Fork 0
SubSync v1.0.1: exception filter, DTO hardening, dashboard spend fix, API consolidation, test fixes #2
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
Merged
Merged
SubSync v1.0.1: exception filter, DTO hardening, dashboard spend fix, API consolidation, test fixes #2
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
fe3363c
Initial plan
Copilot 4bf464f
feat: v1.0.1 improvements - exception filter, DTO validation, dashboa…
Copilot 72da03a
docs: add CHANGELOG and template version in release checklist
ejames-dev c5be9c9
chore: use cross-env for dev scripts so they work on macOS/Linux
ejames-dev File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,47 @@ | ||
| # Changelog | ||
|
|
||
| All notable changes to SubSync are documented in this file. | ||
|
|
||
| The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), | ||
| and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). | ||
|
|
||
| ## [Unreleased] | ||
|
|
||
| ### Planned for v1.1.0 | ||
| - Real OAuth integration for at least one provider (Gmail billing import is the highest-leverage target). | ||
| - Auto-update via `electron-updater` so portable users have a real upgrade path. | ||
| - macOS and Linux desktop builds. | ||
| - CSV / JSON export of subscriptions. | ||
| - Backup and restore of the local SQLite database. | ||
| - Notification worker wired up to the existing reminder preferences. | ||
|
|
||
| ## [1.0.1] - TBD | ||
|
|
||
| See [`docs/release-notes-v1.0.1.md`](docs/release-notes-v1.0.1.md) for the full notes. | ||
|
|
||
| ### Added | ||
| - Global `HttpExceptionFilter` so API errors return consistent JSON payloads instead of leaking stack traces. | ||
| - DTO validation on subscription, settings, and email-ingest endpoints. | ||
|
|
||
| ### Fixed | ||
| - Dashboard monthly spend and spend-by-category now exclude `canceled_pending` subscriptions. | ||
| - `subscriptions.service.spec.ts` mocks the `ServiceCatalogService` dependency correctly and uses the `billingAmountCents` integer field. | ||
| - Cross-platform `dev:api` / `dev:web` scripts (previous `set VAR=...&&` form only worked on Windows). | ||
|
|
||
| ### Changed | ||
| - Consolidated duplicated fetch helpers in the web client's `lib/api.ts`. | ||
|
|
||
| ## [1.0.0] - 2026-05 (prior release) | ||
|
|
||
| See [`docs/release-notes-v1.0.0.md`](docs/release-notes-v1.0.0.md). | ||
|
|
||
| ### Added | ||
| - Windows portable desktop executable bundling the NestJS API and Next.js web client. | ||
| - Local SQLite persistence for subscriptions, integrations, and settings. | ||
| - Dashboard summary metrics, renewal stack, and status-change feed. | ||
| - Manual subscription CRUD with `SubscriptionEvent` logging. | ||
| - Billing email import endpoint that creates or updates subscriptions. | ||
|
|
||
| ### Known limitations | ||
| - Provider `Connect` actions persist local state only — no real third-party OAuth. | ||
| - The portable executable is unsigned, so Windows SmartScreen may warn on first launch. |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,6 @@ | ||
| { | ||
| "name": "api", | ||
| "version": "1.0.0", | ||
| "version": "1.0.1", | ||
| "description": "", | ||
| "author": "", | ||
| "private": true, | ||
|
|
||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,52 @@ | ||
| import { | ||
| ArgumentsHost, | ||
| Catch, | ||
| ExceptionFilter, | ||
| HttpException, | ||
| HttpStatus, | ||
| Logger, | ||
| } from '@nestjs/common'; | ||
| import { Response } from 'express'; | ||
|
|
||
| @Catch() | ||
| export class HttpExceptionFilter implements ExceptionFilter { | ||
| private readonly logger = new Logger(HttpExceptionFilter.name); | ||
|
|
||
| catch(exception: unknown, host: ArgumentsHost): void { | ||
| const ctx = host.switchToHttp(); | ||
| const response = ctx.getResponse<Response>(); | ||
|
|
||
| let status = HttpStatus.INTERNAL_SERVER_ERROR; | ||
| let message: string | string[] = 'Internal server error'; | ||
| let error = 'Internal Server Error'; | ||
|
|
||
| if (exception instanceof HttpException) { | ||
| status = exception.getStatus(); | ||
| const exceptionResponse = exception.getResponse(); | ||
| if (typeof exceptionResponse === 'string') { | ||
| message = exceptionResponse; | ||
| error = exceptionResponse; | ||
| } else if ( | ||
| typeof exceptionResponse === 'object' && | ||
| exceptionResponse !== null | ||
| ) { | ||
| const resp = exceptionResponse as Record<string, unknown>; | ||
| if (resp.message !== undefined) { | ||
| message = resp.message as string | string[]; | ||
| } | ||
| if (typeof resp.error === 'string') { | ||
| error = resp.error; | ||
| } | ||
| } | ||
| } else { | ||
| const err = exception instanceof Error ? exception : new Error(String(exception)); | ||
| this.logger.error(err.message, err.stack); | ||
| } | ||
|
|
||
| response.status(status).json({ | ||
| statusCode: status, | ||
| message, | ||
| error, | ||
| }); | ||
| } | ||
| } |
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -25,6 +25,7 @@ export class EmailIngestPayload { | |
|
|
||
| @IsOptional() | ||
| @IsString() | ||
| @MaxLength(50000) | ||
| body?: string; | ||
| } | ||
|
|
||
|
|
||
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,6 @@ | ||
| { | ||
| "name": "web", | ||
| "version": "1.0.0", | ||
| "version": "1.0.1", | ||
| "private": true, | ||
| "scripts": { | ||
| "dev": "next dev", | ||
|
|
||
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
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
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
Oops, something went wrong.
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.
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.
When deleting from the edit form, this now routes through
deleteSubscription, whose sharedapiRequestonly skipsresponse.json()for HTTP 204 responses. The APISubscriptionsController.deletereturnsPromise<void>without@HttpCode(204), so Nest's default DELETE response is a successful empty 200; after the subscription is removed, the helper tries to parse the empty body and rejects, leaving the user on the form with an error instead of navigating back.Useful? React with 👍 / 👎.