Revert "Fix allow date filter comparison on time aspect (#682)"#829
Revert "Fix allow date filter comparison on time aspect (#682)"#829HenningNormann merged 2 commits intomainfrom
Conversation
This reverts commit 226722c.
📝 WalkthroughWalkthroughTwo files modified: one alters time filtering logic in getappevents.sql from timestamptz casting to text comparison, and another adds ten new PL/pgSQL functions and procedures in v0.48 migration for subscription and event management operations including creation, querying, insertion, and validation. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes
Pre-merge checks and finishing touches✅ Passed checks (2 passed)
✨ Finishing touches🧪 Generate unit tests (beta)
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. Comment |
287023c to
6f12c59
Compare
|
There was a problem hiding this comment.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
src/Events/Migration/v0.48/01-functions-and-procedures.sql(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). (1)
- GitHub Check: Analyze (csharp)
🔇 Additional comments (2)
src/Events/Migration/v0.48/01-functions-and-procedures.sql (2)
1-279: Auto-generated migration requires verification of temporal and type semantics.This file is marked as auto-generated from DbTools (line 1). Ensure the code generation tool is handling:
- Proper timezone handling in all timestamp-related operations (particularly in
insert_subscription, which setscurrentTime := NOW())- Consistent parameter types across function signatures
- Correct casting of JSON-extracted values to appropriate SQL types
Additionally, confirm that reverting the
timestamptzcasting ingetappevents_v2(the core of PR #829) actually resolves the original issue #673 without introducing new correctness problems.
120-121: Text-based timestamp comparison in v0.48 revert requires verification of format enforcement and impact.This PR explicitly reverts commit #682 ("Fix allow date filter comparison on time aspect"), switching back from proper
timestamptzcasting to text comparison in thegetappevents_v2function (lines 120–121):AND (_from IS NULL OR cloudevent->>'time' >= _from::text) AND (_to IS NULL OR cloudevent->>'time' <= _to::text)The revert commit provides no explanation for why the prior fix was reverted. Verify:
- ISO8601 format is consistently enforced in the
cloudevent->>'time'field (text comparison only works correctly if format is uniform)- Timezone information handling is correct—
timestamptzcomparison understands time zones; text comparison does not- Edge cases (fractional seconds, timezone offsets, format variations) do not introduce ordering or filtering discrepancies
- Index utilization and query performance are not degraded
If #682's timestamptz approach caused issues, debug and address those issues rather than reverting to the less robust text-comparison approach.



This reverts commit 226722c.
Description
Reverts changes to get app events function introduced to fix the issue below. Not able to recreate the original issue with the previous version that properly used the time index.
Related Issue(s)
Verification
Documentation
Summary by CodeRabbit
Bug Fixes
New Features