Skip to content

Conversation

@sevenzing
Copy link
Contributor

@sevenzing sevenzing commented Nov 18, 2025

Summary by CodeRabbit

  • Bug Fixes
    • Fixed domain expiry date handling during updates to properly preserve existing dates when no new value is provided.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 18, 2025

Walkthrough

The update modifies the SQL query in the domain update statement to use COALESCE($4, expiry_date) for the expiry_date field assignment. This change alters the update semantics so that when a NULL value is passed for the expiry date parameter, the field retains its existing value rather than being overwritten with NULL. The parameter binding order remains unchanged.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

  • Single file modified with a localized SQL logic change
  • NULL handling behavior modification warrants verification of intent
  • No control flow or structural changes; straightforward COALESCE application
  • Confirm that preserving existing expiry_date values on NULL input aligns with intended update semantics

Poem

🐰 A date that dances with the past,
When NULL arrives, we hold it fast—
COALESCE keeps wisdom safe and sound,
No accidental resets bound!
The domain's memory stays in place,
A gentle touch, with quiet grace.

Pre-merge checks and finishing touches

❌ Failed checks (1 warning, 1 inconclusive)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
Title check ❓ Inconclusive The title 'fix(bens): fix update domain' is vague and lacks specificity about what is being fixed in the update domain logic. Consider a more descriptive title that explains the specific fix, such as 'fix(bens): preserve expiry_date when null in domain update' to clarify the behavioral change.
✅ Passed checks (1 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch ll/fix-update-domain

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between ed52c66 and 1651b65.

📒 Files selected for processing (1)
  • blockscout-ens/bens-logic/src/subgraph/sql/create.rs (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: Linting
  • GitHub Check: Unit, doc and integration tests
🔇 Additional comments (1)
blockscout-ens/bens-logic/src/subgraph/sql/create.rs (1)

107-107: Inconsistent NULL handling for optional fields in domain updates.

The COALESCE($4, expiry_date) pattern on line 107 correctly preserves the existing expiry_date when NULL is provided. However, this conflicts with the treatment of resolved_address on line 104, which is also an Option type but uses direct assignment (resolved_address = $1), causing it to overwrite with NULL if None is passed.

Verify:

  1. Is the different NULL-handling intentional? (expiry_date preserves; resolved_address overwrites)
  2. Should resolved_address also use COALESCE($1, resolved_address) for consistency?

If this asymmetry is intentional, document the distinction in code comments.


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.

@sevenzing
Copy link
Contributor Author

@coderabbitai review

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 18, 2025

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@sevenzing sevenzing merged commit 7338d5a into main Nov 18, 2025
6 checks passed
@sevenzing sevenzing deleted the ll/fix-update-domain branch November 18, 2025 17:47
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