Skip to content

chore: fix OData escaping and consistent userId in auth#374

Merged
Israeltheminer merged 2 commits into
mainfrom
chore/minor-fixes
Feb 5, 2026
Merged

chore: fix OData escaping and consistent userId in auth#374
Israeltheminer merged 2 commits into
mainfrom
chore/minor-fixes

Conversation

@Israeltheminer
Copy link
Copy Markdown
Collaborator

@Israeltheminer Israeltheminer commented Feb 5, 2026

Summary

  • Escape single quotes in OneDrive search queries to prevent malformed OData syntax (e.g. searching for "O'Brien")
  • Replace authUser.userId ?? '' with String(authUser._id) across 11 call sites to match the pattern used everywhere else, preventing silent empty-string userId lookups

Changed files

  • convex/onedrive/list_files.ts — escape ' to '' before OData query
  • convex/documents/mutations.ts — 3 occurrences
  • convex/documents/queries.ts — 2 occurrences
  • convex/tone_of_voice/mutations.ts — 1 occurrence
  • convex/tone_of_voice/queries.ts — 2 occurrences
  • convex/websites/queries.ts — 2 occurrences
  • convex/integrations/queries/list.ts — 1 occurrence

Test plan

  • Verify OneDrive search works with names containing single quotes
  • Verify auth checks still pass for documents, tone of voice, websites, and integrations queries/mutations

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Bug Fixes

    • Improved OneDrive search query handling to safely process special characters, ensuring more reliable search results.
  • Improvements

    • Standardized user identification handling across authentication flows for enhanced consistency and reliability.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Feb 5, 2026

📝 Walkthrough

Walkthrough

This PR systematically updates how user identity is derived across multiple mutation and query functions in the Convex platform services. The primary change replaces the userId source from authUser.userId ?? '' to String(authUser._id) in organization membership verification calls across documents, tone of voice, websites, and integrations modules. Additionally, the Onedrive list_files utility now escapes single quotes in search terms before URL encoding. Control flow and error handling remain unchanged across all modifications.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

  • talecorp/poc2#166: Refactors auth component implementation and surfaces _id-based user identity, directly aligning with these changes to pass String(authUser._id) for organization-member checks.
  • talecorp/poc2#209: Migrates getOrganizationMember and Better Auth integration, updating how membership lookups and user ID types are handled in the auth flow.
  • talecorp/poc2#26: Modifies server-side authentication and organization membership flows by adjusting how authenticated user identity is obtained for membership checks.

Comment @coderabbitai help to get the list of available commands and usage tips.

@Israeltheminer Israeltheminer merged commit be1f35f into main Feb 5, 2026
2 checks passed
@Israeltheminer Israeltheminer deleted the chore/minor-fixes branch February 5, 2026 21:19
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.

1 participant