Skip to content

Conversation

@rebelchris
Copy link
Contributor

@rebelchris rebelchris commented Jan 14, 2026

Handle special characters like #, +, ., - in search queries by using
phrase search when detected. This fixes searches for terms like 'c#',
'c++', 'f#', '.net', 'node.js' etc.

Resolves #3440

🤖 Generated with Claude Code

Should fix: dailydotdev/daily#1799

Handle special characters like #, +, ., - in search queries by using
phrase search when detected. This fixes searches for terms like 'c#',
'c++', 'f#', '.net', 'node.js' etc.

Resolves #3440

Co-authored-by: Chris Bongers <[email protected]>
@rebelchris
Copy link
Contributor Author

@claude this is nice, can you add specific tests for the two mentioned endpoints that use this too test against C++ or C# for example>? Keep them lean we a startup

@pulumi
Copy link

pulumi bot commented Jan 14, 2026

🍹 The Update (preview) for dailydotdev/api/prod (at b40903e) was successful.

Resource Changes

    Name                                                   Type                           Operation
~   vpc-native-calculate-top-readers-cron                  kubernetes:batch/v1:CronJob    update
~   vpc-native-clean-zombie-images-cron                    kubernetes:batch/v1:CronJob    update
~   vpc-native-bg-deployment                               kubernetes:apps/v1:Deployment  update
~   vpc-native-update-views-cron                           kubernetes:batch/v1:CronJob    update
+   vpc-native-api-db-migration-d1c4f954                   kubernetes:batch/v1:Job        create
~   vpc-native-ws-deployment                               kubernetes:apps/v1:Deployment  update
+   vpc-native-api-clickhouse-migration-d1c4f954           kubernetes:batch/v1:Job        create
~   vpc-native-clean-zombie-users-cron                     kubernetes:batch/v1:CronJob    update
~   vpc-native-clean-zombie-opportunities-cron             kubernetes:batch/v1:CronJob    update
~   vpc-native-daily-digest-cron                           kubernetes:batch/v1:CronJob    update
-   vpc-native-api-db-migration-b525f57f                   kubernetes:batch/v1:Job        delete
-   vpc-native-api-clickhouse-migration-b525f57f           kubernetes:batch/v1:Job        delete
~   vpc-native-sync-subscription-with-cio-cron             kubernetes:batch/v1:CronJob    update
~   vpc-native-update-trending-cron                        kubernetes:batch/v1:CronJob    update
~   vpc-native-temporal-deployment                         kubernetes:apps/v1:Deployment  update
~   vpc-native-personalized-digest-cron                    kubernetes:batch/v1:CronJob    update
~   vpc-native-update-source-public-threshold-cron         kubernetes:batch/v1:CronJob    update
~   vpc-native-validate-active-users-cron                  kubernetes:batch/v1:CronJob    update
~   vpc-native-personalized-digest-deployment              kubernetes:apps/v1:Deployment  update
~   vpc-native-clean-gifted-plus-cron                      kubernetes:batch/v1:CronJob    update
~   vpc-native-generic-referral-reminder-cron              kubernetes:batch/v1:CronJob    update
~   vpc-native-hourly-notification-cron                    kubernetes:batch/v1:CronJob    update
~   vpc-native-generate-search-invites-cron                kubernetes:batch/v1:CronJob    update
~   vpc-native-update-current-streak-cron                  kubernetes:batch/v1:CronJob    update
~   vpc-native-check-analytics-report-cron                 kubernetes:batch/v1:CronJob    update
~   vpc-native-post-analytics-clickhouse-cron              kubernetes:batch/v1:CronJob    update
~   vpc-native-post-analytics-history-day-clickhouse-cron  kubernetes:batch/v1:CronJob    update
~   vpc-native-user-profile-updated-sync-cron              kubernetes:batch/v1:CronJob    update
~   vpc-native-update-source-tag-view-cron                 kubernetes:batch/v1:CronJob    update
~   vpc-native-update-tags-str-cron                        kubernetes:batch/v1:CronJob    update
~   vpc-native-deployment                                  kubernetes:apps/v1:Deployment  update
~   vpc-native-clean-zombie-user-companies-cron            kubernetes:batch/v1:CronJob    update
~   vpc-native-update-tag-recommendations-cron             kubernetes:batch/v1:CronJob    update
~   vpc-native-update-highlighted-views-cron               kubernetes:batch/v1:CronJob    update
~   vpc-native-private-deployment                          kubernetes:apps/v1:Deployment  update
~   vpc-native-clean-stale-user-transactions-cron          kubernetes:batch/v1:CronJob    update

@claude
Copy link

claude bot commented Jan 14, 2026

Claude finished @rebelchris's task in 3m 37s —— View job


Tests added successfully! ✅

Completed:

  • Read PR changes to understand the implementation
  • Find the two endpoints using this search functionality
  • Locate existing test files
  • Add lean tests for C++ and C# searches
  • Commit and push changes

Summary

Added 4 lean tests (2 per endpoint) to verify special character handling in search queries:

searchBookmarksSuggestions (__tests__/bookmarks.ts:1073-1111)

  • C++ search test
  • C# search test

searchReadingHistorySuggestions (__tests__/users.ts:3444-3482)

  • C++ search test
  • C# search test

Each test creates a post with the special character in the title, sets up the required data (bookmark or view), and verifies that:

  1. The query is preserved correctly
  2. Results are returned (hits.length > 0)

The tests follow the existing patterns in the codebase and are kept lean as requested. The CI will run the full test suite to verify everything works.

--- |

Add lean tests for searchBookmarksSuggestions and searchReadingHistorySuggestions
to verify that special characters in search queries (like c++, c#) are handled
correctly by the new phrase search implementation.

Co-authored-by: Chris Bongers <[email protected]>
@rebelchris
Copy link
Contributor Author

@claude you have some linting issues, can you fix those quickly.

@claude
Copy link

claude bot commented Jan 14, 2026

Claude finished @rebelchris's task in 2m 3s —— View job


Linting issues fixed! ✅

Completed:

  • Identify the linting issue
  • Fix regex character class escaping
  • Commit and push fixes

Summary

Fixed the linting issue in src/schema/common.ts:198. The regex character class had unnecessary escape sequences:

  • Changed /[#\+\.\-]/ to /[#+.\-]/
  • In character classes, + and . don't need escaping
  • The - is kept escaped as it's not at the beginning or end of the class

The fix has been committed and pushed. CircleCI will re-run the build to verify everything passes.


@rebelchris rebelchris merged commit 2d8823c into main Jan 14, 2026
8 of 10 checks passed
@rebelchris rebelchris deleted the claude/issue-3440-20260114-1329 branch January 14, 2026 13:54
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.

Local search issues 🐛 BUG: Searching in Bookmarks for "C#" posts

2 participants