SubSync v1.0.1: exception filter, DTO hardening, dashboard spend fix, API consolidation, test fixes#2
Conversation
…rd spend fix, API consolidation, test fixes Co-authored-by: ejames-dev <180847219+ejames-dev@users.noreply.github.com>
- 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>
There was a problem hiding this comment.
💡 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); |
There was a problem hiding this comment.
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 👍 / 👎.
Bundles several targeted v1.0.1 improvements across the API and web layers.
API
Global exception filter
Added
HttpExceptionFilter(@Catch()) registered inmain.ts. All errors now emit a uniform{ statusCode, message, error }envelope. Unexpected runtime errors are caught, logged with stack traces via NestJSLogger, and returned as clean 500s.DTO validation hardening
CreateSubscriptionDto:@MaxLengthonserviceId(100),planName(150),billingCurrency(3),paymentLast4(4),notes(1,000);paymentSourcetightened from@IsString→@IsIn(['card','paypal','gift','other']).UpdateSettingsDto:@Max(365)added to previously unboundedleadTimeDays.EmailIngestPayload:@MaxLength(50000)onbody.Dashboard spend calculation
canceled_pendingsubscriptions now excluded frommonthlyEquivalentSpendandspendByCategory. These are already canceled and were silently inflating ongoing cost totals.Web
API layer consolidation
subscription-form.tsxwas making rawfetchcalls with duplicated base-URL resolution. AddedupdateSubscription(id, payload)toapi.tsand refactored the form to use the typed helpers (createSubscription,updateSubscription,deleteSubscription).Tests
subscriptions.service.spec.tshad two bugs that prevented the suite from running correctly:ServiceCatalogServicewas missing from the constructor call — would throwTypeErrorat runtime.billingAmount: new Prisma.Decimal(15)instead of the actual schema fieldbillingAmountCents: 1500.All 5 unit tests now pass.
Misc
1.0.1.docs/release-notes-v1.0.1.mdadded.💡 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.