Skip to content

Fix Feed page for search predicates with overlay array predicates#676

Merged
SeanCassiere merged 2 commits intoTanStack:mainfrom
Julienng:fix-feed-array-overlaps-predicates
Feb 7, 2026
Merged

Fix Feed page for search predicates with overlay array predicates#676
SeanCassiere merged 2 commits intoTanStack:mainfrom
Julienng:fix-feed-array-overlaps-predicates

Conversation

@Julienng
Copy link
Contributor

@Julienng Julienng commented Jan 21, 2026

Hi!

When using the page https://tanstack.com/feed?page=1&pageSize=50&viewMode=table&libraries=%5B%22router%22%5D

The query in Drizzle is failing because of an incorrect query generation:

select "id", "entry_id", "entry_type", "title", "content", "excerpt", "published_at", "created_at", "updated_at", "metadata", "library_ids", "partner_ids", "tags", "show_in_feed", "featured", "auto_synced", "last_synced_at"
from "feed_entries"
where (
       "feed_entries"."show_in_feed" = $1
  and  "feed_entries"."published_at" >= $2
  and  "feed_entries"."published_at" <= $3
  and  "feed_entries"."library_ids" && ARRAY[$4]::text[]
)--                                    ~~~~~~~~~
--                                         ^-- sql driver is not happy with that
order by "feed_entries"."published_at" DESC
-- params: true,1970-01-01T00:00:00.000Z,2026-01-21T18:35:09.396Z,router

By looking and searching at the Drizzle doc, I've found arrayOverlaps(posts.tags, ['Typescript', 'ORM']) (https://orm.drizzle.team/docs/operators#arrayoverlaps)

When looking at the generated query, it looks like this:

select "id", "entry_id", "entry_type", "title", "content", "excerpt", "published_at", "created_at", "updated_at", "metadata", "library_ids", "partner_ids", "tags", "show_in_feed", "featured", "auto_synced", "last_synced_at"
from "feed_entries"
where (
       "feed_entries"."show_in_feed" = $1
  and  "feed_entries"."published_at" >= $2
  and  "feed_entries"."published_at" <= $3
  and  "feed_entries"."library_ids" && $4
)
order by "feed_entries"."published_at" DESC
-- params: true,"1970-01-01T00:00:00.000Z","2026-01-21T18:45:32.506Z","{\"start\"}"

So the query's initial behavior is maintained but without an SQL error.

PR Status:

  • I have no data locally to test the query behavior; it should be the same (&& predicate is kept)
  • The SQL error is fixed
  • I was blocked because of the pre-commit hook locally; I had to --no-verify to get to the PR. need a check if everything is good
  • I've migrated all ARRAY[${sql.join patterns, but two of them needed a cast for the enum values: filters.useCases and data.capabilityFilter

@netlify
Copy link

netlify bot commented Jan 21, 2026

Deploy Preview for tanstack ready!

Name Link
🔨 Latest commit ab001c6
🔍 Latest deploy log https://app.netlify.com/projects/tanstack/deploys/69868cbba7c04a00086cc6fe
😎 Deploy Preview https://deploy-preview-676--tanstack.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 21 (🔴 down 3 from production)
Accessibility: 90 (no change from production)
Best Practices: 75 (🔴 down 8 from production)
SEO: 97 (no change from production)
PWA: 70 (no change from production)
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify project configuration.

@Julienng Julienng force-pushed the fix-feed-array-overlaps-predicates branch from 89fff6b to 24ca308 Compare January 22, 2026 11:36
@SeanCassiere SeanCassiere force-pushed the fix-feed-array-overlaps-predicates branch from 24ca308 to ab001c6 Compare February 7, 2026 00:52
Copy link
Member

@SeanCassiere SeanCassiere left a comment

Choose a reason for hiding this comment

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

👏🏼 thank you!

@SeanCassiere SeanCassiere merged commit fd367b7 into TanStack:main Feb 7, 2026
7 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