Skip to content

fix: Datasource query doesn't fail when created At field is missing#41665

Merged
sondermanish merged 1 commit intoreleasefrom
fix/export-failure-ds-timestamp
Mar 27, 2026
Merged

fix: Datasource query doesn't fail when created At field is missing#41665
sondermanish merged 1 commit intoreleasefrom
fix/export-failure-ds-timestamp

Conversation

@sondermanish
Copy link
Copy Markdown
Contributor

@sondermanish sondermanish commented Mar 27, 2026

Description

  • Improvements
    Enhanced reliability for recently used datasource tracking with improved error handling and logging to ensure operations continue gracefully when issues occur.

Fixes Issue URL

Warning

If no issue exists, please create an issue first, and check with the maintainers if the issue is valid.

Automation

/ok-to-test tags="@tag.Git"

🔍 Cypress test results

Tip

🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉
Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/23643457313
Commit: f32b9dd
Cypress dashboard.
Tags: @tag.Git
Spec:


Fri, 27 Mar 2026 11:59:31 UTC

Communication

Should the DevRel and Marketing teams inform users about this change?

  • Yes
  • No

Summary by CodeRabbit

  • Improvements

    • Enhanced reliability for recently used datasource tracking with improved error handling and logging to ensure operations continue gracefully when issues occur.
  • Refactor

    • Optimized datasource filtering and sorting logic for improved performance.

@sondermanish sondermanish self-assigned this Mar 27, 2026
@sondermanish sondermanish requested a review from subrata71 March 27, 2026 11:09
@github-actions github-actions bot added the Bug Something isn't working label Mar 27, 2026
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Mar 27, 2026

Walkthrough

The markRecentlyUsed(...) method in DatasourceServiceCEImpl was refactored to directly sort and filter Datasource objects by createdAt (descending), removing null values, then set the isRecentlyCreated flag on results. Previously, the method used indexed tuples for sorting. Error handling with warning logs was added. Unused Reactor imports were removed.

Changes

Cohort / File(s) Summary
Datasource Marking Refactor
app/server/appsmith-server/src/main/java/com/appsmith/server/datasources/base/DatasourceServiceCEImpl.java
Simplified markRecentlyUsed(...) from tuple-based indexing to direct list sorting/filtering; added try/catch error handling with warning logs; removed unused Tuple2 and Tuples imports.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Poem

Tuples once indexed, now gently retired,
Straight sorting takes place where complexity's expired.
Stream flows simpler, null guards in place,
Errors handled with grace and a logging embrace. 📋✨

🚥 Pre-merge checks | ✅ 1 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Description check ⚠️ Warning PR description lacks issue reference and technical details. The provided URL in 'Fixes' field is broken, and key implementation context from the summary is missing. Fix the issue link to properly reference the Linear issue. Add technical context explaining the root cause and solution approach to the Description section for clarity.
✅ Passed checks (1 passed)
Check name Status Explanation
Title check ✅ Passed The title directly reflects the main change: fixing a failure when the createdAt field is missing by updating markRecentlyUsed() to handle null createdAt values gracefully.

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

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/export-failure-ds-timestamp

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.

@sondermanish sondermanish added the ok-to-test Required label for CI label Mar 27, 2026
@subrata71 subrata71 changed the title fix: Datasource query doesn't fail when created At filed is missing fix: Datasource query doesn't fail when created At field is missing Mar 27, 2026
@sondermanish sondermanish merged commit b47d782 into release Mar 27, 2026
53 checks passed
@sondermanish sondermanish deleted the fix/export-failure-ds-timestamp branch March 27, 2026 14:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug Something isn't working ok-to-test Required label for CI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants