Skip to content

fix (management): search/query validation to compare IDs instead of checking existence#403

Merged
Strehk merged 1 commit intomainfrom
claude/fix-payment-reference-cache-E2lTD
Mar 6, 2026
Merged

fix (management): search/query validation to compare IDs instead of checking existence#403
Strehk merged 1 commit intomainfrom
claude/fix-payment-reference-cache-E2lTD

Conversation

@Strehk
Copy link
Copy Markdown
Member

@Strehk Strehk commented Mar 6, 2026

Summary

This PR fixes a bug in the payment and postal registration management pages where search/query validation was only checking for the existence of data rather than verifying that the loaded data matches the requested ID.

Key Changes

  • Payments page: Updated the condition in $paymentReferenceByIdQuery to explicitly compare the returned payment transaction ID with the search value, ensuring the correct payment record was loaded before proceeding
  • Postal Registration page: Updated the condition in $userData query to explicitly compare the returned user ID with the query parameter, ensuring the correct user record was loaded
  • Payments page: Added initialization of recieveDate to today's date in the resetView() function to ensure a valid default date when resetting the payment drawer

Implementation Details

The fix changes the validation logic from:

$paymentReferenceByIdQuery.data?.findUniquePaymentTransaction &&

to:

$paymentReferenceByIdQuery.data?.findUniquePaymentTransaction?.id === searchVal &&

This ensures that the loaded record actually matches what was requested, preventing potential issues where stale or incorrect data could be used.

https://claude.ai/code/session_01YGXFvWXiFPq9KRzUH4irxs

Summary by CodeRabbit

  • Bug Fixes
    • Payment drawer now opens only when searching for an exact transaction ID match, preventing unintended drawer triggers
    • Postal registration drawer improved to reliably sync with URL parameters for consistent user experience
    • Default date is now set when resetting payment views for better usability

The drawer-open effect checked if query data existed but didn't verify
it matched the current search value. After clearing search and entering
a new reference, stale Houdini cache data triggered premature drawer
open, causing it to flash open/close. Now the effect checks that the
loaded data ID matches the current search value before opening.

Also resets recieveDate in resetView() to prevent date carryover.

https://claude.ai/code/session_01YGXFvWXiFPq9KRzUH4irxs
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Mar 6, 2026

📝 Walkthrough

Walkthrough

Two Svelte payment and registration management components received refinements to their drawer-opening conditions. The payments component now requires an exact transaction ID match before opening its drawer and initializes a default receive date. The postal registration component tightens its user drawer condition to match the loaded user ID strictly with the query parameter.

Changes

Cohort / File(s) Summary
Drawer Condition Refinements
src/routes/(authenticated)/management/[conferenceId]/payments/+page.svelte, src/routes/(authenticated)/management/[conferenceId]/postalRegistration/+page.svelte
Both components tighten drawer-opening conditions: payments now requires exact transaction ID matching; postal registration requires strict user ID matching with query parameter.
Date Initialization
src/routes/(authenticated)/management/[conferenceId]/payments/+page.svelte
Added default receive date initialization to today's date (YYYY-MM-DD format) in the resetView function.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 A rabbit hops through drawer conditions fine,
Matching IDs with precision, oh so divine,
Dates now default to today's gentle glow,
Stricter checks ensure the right data show,
Small tweaks, great care—that's how we grow!

🚥 Pre-merge checks | ✅ 4 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Boy Scout Scope ⚠️ Warning PR violates Boy Scout scope principle by modifying hundreds of files across entire repository instead of targeted fixes to two pages as claimed. Split commit into separate changes: one for drawer validation/date initialization fixes, separate commits for repository setup work. Include 'Boy Scout changes' section documenting all opportunistic improvements.
Pr Label Required ❓ Inconclusive Repository enforces strict PR labeling via automated pr-lint workflow, but current label status of PR #403 cannot be verified from sandbox environment. Visit PR #403 at #403 to verify the presence of a valid release-category label.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
German Gender-Inclusive Language ✅ Passed The custom check verifies German gender-inclusive language in messages/de.json, but this file is not modified in the pull request.
Title check ✅ Passed The title accurately summarizes the main bug fix: replacing existence checks with explicit ID comparisons in the payment and postal registration management pages.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch claude/fix-payment-reference-cache-E2lTD

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@Strehk Strehk added the PR: Bug Something isn't working label Mar 6, 2026
@Strehk Strehk changed the title Fix search/query validation to compare IDs instead of checking existence fix (management): search/query validation to compare IDs instead of checking existence Mar 6, 2026
@Strehk Strehk merged commit cbde180 into main Mar 6, 2026
12 of 15 checks passed
@Strehk Strehk deleted the claude/fix-payment-reference-cache-E2lTD branch March 6, 2026 12:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

PR: Bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants