Skip to content

[codex] Fix frontend review bugs#140

Merged
KyleTryon merged 6 commits into
mainfrom
codex/fix-app-api-integration-bugs
May 22, 2026
Merged

[codex] Fix frontend review bugs#140
KyleTryon merged 6 commits into
mainfrom
codex/fix-app-api-integration-bugs

Conversation

@KyleTryon
Copy link
Copy Markdown
Contributor

@KyleTryon KyleTryon commented May 22, 2026

Summary

  • persist initial subscription filter rules during add-subscription flow
  • invalidate article count queries after read/save/bulk mutations
  • derive standard article read/save controls from article props so cache updates and rollbacks are reflected
  • keep the subscription creation concurrency guard active after clearing old polling state

Validation

  • pnpm --filter @tuvixrss/app type-check
  • pnpm --filter @tuvixrss/app lint (passes with existing warnings in data-table.tsx and trpc-provider.tsx)
  • pnpm --filter @tuvixrss/app exec vitest run src/components/app/article-item.test.tsx

Notes

  • A full pnpm --filter @tuvixrss/app test -- src/components/app/article-item.test.tsx invocation unexpectedly ran the whole app suite and hit existing debug-sentry route test failures where the rendered body is empty. The direct targeted Vitest run above passed.

@KyleTryon KyleTryon marked this pull request as ready for review May 22, 2026 05:48
@KyleTryon KyleTryon requested a review from Copilot May 22, 2026 05:48
Comment thread packages/api/src/routers/articles.ts Outdated
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Fixes several frontend/API integration mismatches across the app, API router, and build tooling to align pagination behavior, Docker build context, subscription icon handling, and Better Auth base URL resolution.

Changes:

  • Adjust filtered-articles pagination to apply cursor/offset after subscription filtering.
  • Include packages/api and packages/tricorder sources in the app Docker build stage to satisfy workspace/type-check dependencies.
  • Align subscription creation to use camelCase iconUrl from feed preview and improve Better Auth base URL resolution for relative VITE_API_URL.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
packages/app/src/routes/app/subscriptions.tsx Uses feedPreview.data.iconUrl (camelCase) and always sends iconType: "auto" during subscription creation.
packages/app/src/lib/auth-client.ts Adds resolveAuthBaseURL to derive Better Auth baseURL from absolute or relative VITE_API_URL values.
packages/app/Dockerfile Copies API + tricorder sources into the builder stage so the app workspace build/type-check has required sources available.
packages/api/src/routers/articles.ts Changes filtered-path pagination to apply cursor/offset after filtering and updates hasMore/total derivation accordingly.
Comments suppressed due to low confidence (2)

packages/api/src/routers/articles.ts:455

  • hasMore is derived from visibleResults.length > limit, but visibleResults is limited by the single fetchLimit query. If subscription filters are highly selective, you can end up with visibleResults.length <= limit even when additional matching articles exist beyond fetchLimit, causing infinite scroll to stop early. To make hasMore reliable, consider looping additional DB fetches (in fixed-size chunks) until you either have filteredOffset + limit + 1 filtered items or you exhaust the underlying query.
        const visibleResults = cleanedResults.slice(filteredOffset);

        // Check if we have more than requested (for hasMore)
        hasMore = visibleResults.length > limit;

        // Return only the requested number of items
        paginatedResults = visibleResults.slice(0, limit);

packages/api/src/routers/articles.ts:357

  • This change alters cursor/offset semantics when subscription filters are enabled (cursor is now applied after filtering). There don’t appear to be tests covering cursor-based pagination in the filtered path (e.g., fetching page 1, then cursor=limit, ensuring no skipped/duplicated items). Adding a dedicated test would help prevent regressions for the specific bug fixed here.
        // FILTERED PATH: Has subscription filters, must fetch more and filter.
        // The cursor sent by the frontend represents the number of already
        // rendered articles, so apply it after filtering instead of as a raw
        // database offset.
        const filteredOffset = cursor ?? offset;
        const fetchLimit = Math.max((filteredOffset + limit + 1) * 3, 100);

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread packages/api/src/routers/articles.ts Outdated
@KyleTryon KyleTryon changed the title [codex] Fix app API integration bugs [codex] Fix frontend review bugs May 22, 2026
@KyleTryon KyleTryon merged commit 43e3816 into main May 22, 2026
14 checks passed
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