Removal of public share/link feature - #77
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR removes the public invoice share/link feature end-to-end (UI, backend routes/controllers, and DB schema) and updates documentation to reflect a direct-email delivery focus.
Changes:
- Removes the frontend public invoice page and all “publish/unpublish/copy public link” UI/actions from the invoice detail page.
- Removes backend public invoice endpoints and publish/unpublish admin endpoints, plus related controller/util code.
- Drops
share_tokenfrom the invoices schema/migrations and updates DB migration logic to recreate invoices to the current schema.
Reviewed changes
Copilot reviewed 15 out of 15 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| README.md | Updates feature description to remove public share links and emphasize email delivery. |
| frontend/src/routes/public/invoices/[token]/+page.svelte | Public invoice page content removed (currently left as an empty routable page). |
| frontend/src/routes/public/invoices/[token]/+page.server.ts | Removes server load that passed the token to the public invoice page. |
| frontend/src/routes/invoices/[id]/+page.svelte | Removes publish/unpublish UI, banner, and copy-link behavior from invoice details. |
| frontend/src/routes/invoices/[id]/+page.server.ts | Removes publish/unpublish form actions and “published” banner flag. |
| frontend/src/lib/i18n/locales/en.json | Removes translation keys related to publishing/public links. |
| backend/src/utils/uuid.ts | Removes share-token generator utility. |
| backend/src/types/index.ts | Removes shareToken from the Invoice type. |
| backend/src/routes/public.ts | Deletes public invoice endpoints, leaving only non-invoice public endpoints (e.g., XML profiles). |
| backend/src/routes/admin.ts | Removes publish/unpublish routes and disables share-link generation in email composition. |
| backend/src/database/migrations.sql | Drops share_token column/index from invoices table schema for new DBs. |
| backend/src/database/migrations_clean.sql | Drops share_token column/index from invoices table schema for clean migrations. |
| backend/src/database/init.ts | Updates invoice table migration to recreate to current schema (including removing share_token). |
| backend/src/controllers/invoices.ts | Removes share-token creation/lookup/publish/unpublish logic; adjusts inserts/selects accordingly (with one duplication insert bug). |
| backend/src/controllers/invoices_clean.ts | Removes legacy share-token usage in the “clean” controller implementation. |
Suppressed comments (1)
backend/src/database/init.ts:475
- This migration function now upgrades the invoices table to the current schema (including dropping
share_tokenand ensuring new columns), but the post-migration log message still says it only supports "voided" and "complete". Updating the log message will avoid misleading operational diagnostics.
database.execute("COMMIT");
console.log(
" Migrated invoices table to support 'voided' and 'complete' statuses",
);
Comment on lines
1967
to
1970
| const origin = c.req.header("origin") || | ||
| c.req.header("referer")?.replace(/\/$/, "") || ""; | ||
| const shareLink = invoice.shareToken && origin | ||
| ? `${origin}/public/invoices/${invoice.shareToken}` | ||
| : null; | ||
| const shareLink = null; | ||
|
|
Comment on lines
1168
to
1172
| original.paymentTerms || null, | ||
| original.notes || null, | ||
| newShare, | ||
| "", | ||
| now, | ||
| now, |
| </div> | ||
| </main> | ||
| </div> | ||
| No newline at end of file |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Removal of public share/link feature
Invoicing software really shouldnt be open to the public and sending companies URLs to click on is about as shady. Even security-wise you can't argue that sending a link of your invoice is safer than sending it as PDF.
With the focus on sending invoices through email, the entire public link front- and back-end is not needed anymore for my application of this software and more of a legacy leftover thing from Invio.
Thus this will be removed, making space for more suefull options in the future.