fix: apply lint and test fixes for waitlist and firestore packages#6
Merged
Conversation
- Auto-fix 5181 ESLint style errors in @please-auth/waitlist
(tabs to spaces, double to single quotes, remove semicolons)
- Manually fix remaining tab character in error-codes.ts
- Add --passWithNoTests flag to firestore vitest run
- Fix client.ts status method double-wrapping query params
Change signature to (data: { query: { token: string } })
and extract data.query before passing to $fetch
There was a problem hiding this comment.
1 issue found across 13 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="packages/waitlist/src/client.ts">
<violation number="1" location="packages/waitlist/src/client.ts:64">
P1: The new `status` parameter shape is not backward-compatible and can silently drop the token for existing `{ token }` callers. Accept both shapes or normalize input before building the query.</violation>
</file>
Architecture diagram
sequenceDiagram
participant App as Application / UI
participant Client as Waitlist Client
participant Hook as Waitlist Middleware (Hook)
participant API as Waitlist API Endpoints
participant DB as Database (Adapter)
Note over App,DB: Waitlist Status Check (Bug Fix)
App->>Client: CHANGED: status({ query: { token } })
Client->>Client: Extract query object from data
Client->>API: GET /waitlist/status (with query params)
API->>DB: findOne({ lookupToken: token })
DB-->>API: Waitlist Entry
API-->>App: { status: "pending" | "approved" | ... }
Note over App,DB: Registration Gate (Core Architectural Flow)
App->>Hook: POST /sign-up/email
Hook->>Hook: Match path in interceptPaths
Hook->>DB: findUserByEmail(email)
alt User is new (Waitlist Check)
Hook->>DB: findOne({ email, status: "approved" })
DB-->>Hook: Result
alt Not Approved
Hook-->>App: 403 Forbidden (NOT_APPROVED)
else Approved
Hook-->>App: Allow Registration Proceed
end
else User Exists (Login)
Hook-->>App: Allow Login Proceed
end
Note over App,DB: Admin Action (Context)
App->>API: POST /waitlist/approve { email }
API->>API: Verify Admin Session/Role
API->>DB: update(status: "approved", inviteCode: UUID)
DB-->>API: Updated Entry
opt sendInviteEmail configured
API->>API: Trigger Email Service
end
API-->>App: 200 OK (Updated Entry)
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
Update the @example in waitlistClient() to reflect the corrected status() signature: { query: { token } } instead of { token }.
better-auth's getTestInstance uses node:sqlite (Node.js 22.5+ built-in module). CI test job was failing because Node.js was not explicitly installed. Add actions/setup-node with node-version 22 to the test job.
- Upgrade Node.js from 22 to 24 for test job - Set fail_ci_if_error to false for Codecov upload since the repository may not be configured on Codecov yet
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.
Summary
@please-auth/waitlistpackage (5181 style errors: tabs to spaces, double to single quotes, remove semicolons) and manually fixed one remaining tab inerror-codes.ts--passWithNoTestsflag tovitest runin@please-auth/firestoreso CI passes when no test files exist yetclient.tsstatusmethod that was double-wrapping query params; updated signature from(data: { token: string })to(data: { query: { token: string } })and extracteddata.querybefore passing to$fetchTest Plan
pnpm lintinpackages/waitlistpnpm testin bothpackages/waitlistandpackages/firestorepnpm buildinpackages/waitlistSummary by cubic
Fixes query param handling in the
@please-auth/waitlistclient and ensures@please-auth/firestoretests pass when empty. CI now uses Node.js 24 fornode:sqliteand makes Codecov upload non-blocking.Bug Fixes
@please-auth/waitlist: Fixedclient.tsstatusmethod that double-wrapped query params; signature is now(data: { query: { token: string } })and passesdata.queryto the fetch call. Updatedstatus()docs and examples.@please-auth/firestore: Added--passWithNoTeststovitest runso CI passes when the package has no tests.node:sqliteand set Codecov upload to non-blocking.Migration
auth.waitlist.status({ token })withauth.waitlist.status({ query: { token } }).Written for commit 71e1254. Summary will update on new commits.