Skip to content

SubSync v1.0.1: exception filter, DTO hardening, dashboard spend fix, API consolidation, test fixes#2

Merged
ejames-dev merged 4 commits into
mainfrom
copilot/suggest-improvements-v1-0-1
May 17, 2026
Merged

SubSync v1.0.1: exception filter, DTO hardening, dashboard spend fix, API consolidation, test fixes#2
ejames-dev merged 4 commits into
mainfrom
copilot/suggest-improvements-v1-0-1

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 19, 2026

Bundles several targeted v1.0.1 improvements across the API and web layers.

API

Global exception filter

Added HttpExceptionFilter (@Catch()) registered in main.ts. All errors now emit a uniform { statusCode, message, error } envelope. Unexpected runtime errors are caught, logged with stack traces via NestJS Logger, and returned as clean 500s.

DTO validation hardening

  • CreateSubscriptionDto: @MaxLength on serviceId (100), planName (150), billingCurrency (3), paymentLast4 (4), notes (1,000); paymentSource tightened from @IsString@IsIn(['card','paypal','gift','other']).
  • UpdateSettingsDto: @Max(365) added to previously unbounded leadTimeDays.
  • EmailIngestPayload: @MaxLength(50000) on body.

Dashboard spend calculation

canceled_pending subscriptions now excluded from monthlyEquivalentSpend and spendByCategory. These are already canceled and were silently inflating ongoing cost totals.

Web

API layer consolidation

subscription-form.tsx was making raw fetch calls with duplicated base-URL resolution. Added updateSubscription(id, payload) to api.ts and refactored the form to use the typed helpers (createSubscription, updateSubscription, deleteSubscription).

Tests

subscriptions.service.spec.ts had two bugs that prevented the suite from running correctly:

  • ServiceCatalogService was missing from the constructor call — would throw TypeError at runtime.
  • Entity fixture used billingAmount: new Prisma.Decimal(15) instead of the actual schema field billingAmountCents: 1500.

All 5 unit tests now pass.

Misc

  • All packages bumped to 1.0.1.
  • docs/release-notes-v1.0.1.md added.

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

…rd spend fix, API consolidation, test fixes

Co-authored-by: ejames-dev <180847219+ejames-dev@users.noreply.github.com>
Copilot AI changed the title [WIP] Suggest improvements for version 1.0.1 of SubSync SubSync v1.0.1: exception filter, DTO hardening, dashboard spend fix, API consolidation, test fixes Mar 19, 2026
Copilot AI requested a review from ejames-dev March 19, 2026 18:06
ejames-dev and others added 2 commits May 17, 2026 14:48
- Seed CHANGELOG.md with 1.0.0 and 1.0.1 entries plus 1.1.0 candidates
- Replace hardcoded SubSync 1.0.0.exe references with ${VERSION} so the
  checklist stays valid across releases

Deferred: cross-env fix for the Windows-only `set VAR=...&&` dev scripts.
Requires a fresh npm install to refresh package-lock.json; tracked for a
follow-up commit before tagging v1.0.1.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
The previous `set VAR=...&&` syntax only ran on Windows cmd. Switching
to cross-env keeps the same env-var semantics across all platforms.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@ejames-dev ejames-dev marked this pull request as ready for review May 17, 2026 17:38
@ejames-dev ejames-dev merged commit ef19b47 into main May 17, 2026
@ejames-dev ejames-dev deleted the copilot/suggest-improvements-v1-0-1 branch May 17, 2026 17:38
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c5be9c946f

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

if (!response.ok) {
throw new Error(await response.text());
}
await deleteSubscription(initial.id);
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Avoid parsing the empty delete response

When deleting from the edit form, this now routes through deleteSubscription, whose shared apiRequest only skips response.json() for HTTP 204 responses. The API SubscriptionsController.delete returns Promise<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 👍 / 👎.

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.

2 participants