Repository navigation
Conversation
added 3 commits
November 4, 2026 20:58
Repo-wide pass removing dead code, duplicated helpers and hand-rolled stdlib, behaviour unchanged unless noted below. Net -2,130 lines. - pkg/datevalidation: drop the offline holiday year list (unreachable from production) and the Coverage type, which only ever mirrored err != nil. - pkg: chi's RequestSize replaces LimitRequestSize; remove ValidateVar, database.Close/CloseRedis/RedisConfig and logger.Debug; table-driven pool collector; httputil.Validate replaces 24 identical validation blocks. - internal: shared ownedCalendar / participantOn checks, userColumns and passkeyColumns scan helpers, one chat-channel loop and postJSON in notify, table-built robots.txt and sitemap, unreachable ICS paths removed. - frontend: remove useBuildType and dead store actions/types, the unused week-start localStorage override; reuse the cached date formatter and useEventListener. - Makefile: drop dead targets and the BUILD_TYPE build-arg the Dockerfile ignored. Fixes found along the way: - Remove TOTP_PERIOD/TOTP_DIGITS: any non-default value made MFA enrollment impossible. Remove the unused WEBAUTHN_TIMEOUT. - Deleting a missing user returns 404 instead of 500. - Stop logging the first 20 characters of webhook URLs. - Make TestSetRefreshToken tolerant of a second boundary.
Second repo-wide pass, behaviour unchanged unless noted below. Net -1,196 lines. - pkg/httputil: DecodeValid replaces 23 decode-then-validate blocks; Response and ValidationError are unexported. - internal: writeCalendarError for the calendar error chains, shared issueSessionTokens for login, magic link and password reset, shared completeLogin for password and passkey, ParseNotifyConfig and ParticipantEmailOn; drop dead SetEmailAsVerified, GetByHash from the TokenRepository interface, always-nil error returns and unused params. - pkg: remove RedisPinger (a pingFunc in cmd/main.go), the locale validator, memoryBroker, pkg/models/enums.go and nagerResult; strings.ContainsAny replaces the password regexes; email.Service keeps its Config; unexport test-only constructors. - cmd: RegisterQuotaRoutes lives once in services.go; route limits use middleware.RateLimitConfig directly. - frontend: drop never-rendered spinners, dead store/API updatePassword, unused props, types and store returns, pass-through wrappers (storeToRefs), 8 orphan i18n keys; native atob/btoa in passkey.ts; reuse intlFormatters, minutesToTime, apiClient and @vueuse helpers. The orphan-key test now matches whole quoted keys. - tooling: one check-compose-env.py replaces three scripts; stale refs removed from Makefile, CI, .golangci.yml and docs. Fixes: - Passkey login sets its refresh cookie through sessioncookie, so it follows JWT_REFRESH_EXPIRY instead of a fixed 7 days. - make dev runs ./cmd/ (./cmd/main.go alone did not compile). - The dev preview pages declare their favicon, removing the /favicon.ico 404 that made the console-errors e2e test flaky.
A tab opened while another tab was refreshing the session adopted the broadcast token mid-restore. Its own replay was then voided as stale, initializeAuth resolved with no user, and the guard sent a signed-in tab to /login. The voided restore now waits for the adoption's /auth/me before the guard decides. Test fixes so every suite is green: - e2e fixtures renew the shared owner token once it nears expiry: a full backend run outlasts the 15-minute token globalSetup leaves behind. - Vitest keeps root-relative asset URLs as strings (file:///logo.png was rejected on Windows) and the locale checks use POSIX paths.
CHANGELOG [Unreleased]: - add the missing user-facing changes: make dev fix, removed Makefile targets, password minimum counted in characters, GET /auth/status and BOOTSTRAP_REQUIRED, root Dockerfile build (#124), webhook URL prefix no longer logged - drop or fold entries that fixed features new in this release - rewrite the reminder bullets in user terms - note that the bundled Compose file does not forward DB_* - put Fixed before Security, as in v2.0.0 THIRD-PARTY-LICENSES: versions from go.mod and package-lock.json, remove date-fns, date-fns-tz, i18n-iso-countries and world-countries, add the Inter font (OFL-1.1) and the new dev dependencies. Swagger @Version: 3.0.0.
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.
Description
Two repo-wide over-engineering passes before v3.0.0: dead code, duplicated helpers and hand-rolled stdlib removed across Go (both modules), the Vue frontend, the e2e fixtures and the tooling, followed by the release documentation checked against v2.0.0. Net -3,094 lines over 192 files, no dependency added or removed. Behaviour is unchanged except for the fixes listed below.
First pass (
4a1f090)pkg
datevalidation: the offline holiday year list was unreachable from production, and theCoveragetype only ever mirrorederr != nil. Both are removed (-207 lines).RequestSizereplaces the copiedLimitRequestSize.ValidateVar,database.Close/CloseRedis/RedisConfigand the package-levellogger.Debugare removed.httputil.Validate(w, v)replaces 24 identical validation blocks. Newmiddleware.RequireUserUUIDreplaces 10 identical user-ID blocks.internal
ownedCalendarreplaces 7 copies,participantOnreplaces 9. Same errors and status codes as before.userColumns/scanUser(9 copies) andpasskeyColumns/scanPasskey.postJSONhelper. A golden test pins the HTML emails byte for byte.robots.txtand the sitemap are built from a const and a table (output byte-identical). Unreachable ICS code paths are removed. Token generators are now onerandomHexper package, with the same hex format.frontend
useBuildType, dead store actions and types, and theweek-start-daylocalStorage override that nothing wrote.intlFormattersanduseEventListener.Makefile
--build-arg BUILD_TYPEthe Dockerfile silently ignored.Second pass (
efe55df)pkg / cmd
httputil.DecodeValidreplaces 23 decode-then-validate blocks;ResponseandValidationErrorare unexported.database.RedisPinger(apingFuncincmd/main.go), the unusedlocalevalidator,broadcast.memoryBroker,pkg/models/enums.goandnagerResult.strings.ContainsAnyreplaces the password regexes;email.Servicekeeps itsConfig; test-only constructors are unexported.RegisterQuotaRouteslives once incmd/services.go; route limits usemiddleware.RateLimitConfigdirectly.internal
writeCalendarErrorfor the calendar error chains; sharedissueSessionTokensfor login, magic link and password reset; sharedcompleteLoginfor password and passkey;ParseNotifyConfig/ParticipantEmailOn.SetEmailAsVerified,GetByHashfrom theTokenRepositoryinterface, always-nil error returns and unused parameters.frontend
updatePassword, unused props, types and store returns, pass-through wrappers (nowstoreToRefs), and 8 orphan i18n keys.atob/btoainpasskey.ts; reuse ofintlFormatters,minutesToTime,apiClientand the@vueusehelpers.tooling
scripts/check-compose-env.pyreplaces three scripts; stale references are removed from the Makefile, CI,.golangci.ymland the docs.Session fix and test stability (
34b041d)/loginwhile still signed in. The voided restore now waits for the adoption's/auth/mebefore the guard decides, with no extra request.globalSetupleaves behind.file:///logo.pngwas rejected on Windows), and the locale checks use POSIX paths.Release documentation (
9c40f49)CHANGELOG.md[Unreleased]checked againstv2.0.0:make dev, the removed Makefile targets, the password minimum counted in characters,GET /api/v1/auth/statusandBOOTSTRAP_REQUIRED, the root Dockerfile in fix(build): restore the migrate-builder stage truncated in two Dockerfiles #124, the webhook URL prefix no longer logged);FixedbeforeSecurity, as in v2.0.0.THIRD-PARTY-LICENSES.md:go.modandpackage-lock.json;date-fns,date-fns-tz,i18n-iso-countriesandworld-countriesare removed;@versionis now 3.0.0. A regenerated spec differs only by the version.Type of Change
Fixes and the breaking change, all user-facing ones recorded in the CHANGELOG:
TOTP_PERIOD/TOTP_DIGITSare removed. Any non-default value made MFA enrollment impossible, because validation always used 30s and 6 digits. The unusedWEBAUTHN_TIMEOUTis removed too.JWT_REFRESH_EXPIRYinstead of a fixed 7 days.make devruns./cmd/(./cmd/main.goalone did not compile)./favicon.ico404 that mademonth grid › renders without console errorsflaky.TestSetRefreshTokenno longer fails when a second boundary passes during the test.Related Issue
None. This is pre-release cleanup.
Testing
httputil.Validate,RequireUserUUID,DeleteUser404, notify HTML golden, cold-tab session adoption, owner-token renewal)go build -tags selfhosted)Run locally on Windows on the final head:
go build,go vetandgolangci-lintreport 0 issues for both modules onselfhostedandcloud.go testpasses against real Postgres 16 and Redis 7 with 0 skips; no-race, as this machine has no C compiler.main.vue-tscand ESLint are clean. Vitest: 978/979. The remaining failure isweekStart› CLDR data, specific to this machine's Node 24.13 ICU (Iceland on Monday); Edge 157 and CI agree with the app's table (Sunday).Checklist
Notes for reviewers
userColumns,passkeyColumns), the trimmed ICSeventsAboveThresholdQuery, and theinitializeAuthchange instores/auth.ts. All are covered by tests, but they deserve a careful look.UpdateAvailabilityused to skip the minimum-duration check if a redundant second calendar read failed. That read is gone, so the check now always runs.CreateCalendarrejects an invalid user ID before decoding the body.VerifyEmailshows the generic message for a 400 without the JSON error envelope, which the backend always sends on that endpoint.handleAvailabilityErrorandhandleRecurrenceErrorstay separate, soErrWeekdayNotAllowedstill answers 500 on recurrences; andskip2/go-qrcodestays.scripts/init-db.sh(documented as hardened)slog's global default JSON frominitcmd.Services(referenced by the ADRs)