Skip to content

Conversation

@SamuelPalaj
Copy link
Contributor

@SamuelPalaj SamuelPalaj commented Dec 10, 2025

Description

  • fixed creation of ProcessResourceId in method stringInQuery, when id is null or an empty string
    Fixes NAE-2301

How Has Been This Tested?

manually

Test Configuration

Name Tested on
OS windows 10
Runtime java 21
Dependency Manager Maven 3.9.9
Framework version Spring Boot 3.4.4
Run parameters
Other configuration

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • My changes have been checked, personally or remotely, with @...
  • I have commented my code, particularly in hard-to-understand areas
  • I have resolved all conflicts with the target branch of the PR
  • I have updated and synced my code with the target branch
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing tests pass locally with my changes:
    • Lint test
    • Unit tests
    • Integration tests
  • I have checked my contribution with code analysis tools:
  • I have made corresponding changes to the documentation:
    • Developer documentation
    • User Guides
    • Migration Guides

Summary by CodeRabbit

  • Bug Fixes
    • Improved search functionality to gracefully handle empty or missing ID inputs during filtering operations, preventing errors and enabling broader matching in search results.

✏️ Tip: You can customize this high-level summary in your review settings.

- fixed creation of ProcessResourceId in method stringInQuery, when id is null or an empty string
@SamuelPalaj SamuelPalaj self-assigned this Dec 10, 2025
@SamuelPalaj SamuelPalaj added bugfix A change that fixes a bug Extra Small labels Dec 10, 2025
@coderabbitai
Copy link

coderabbitai bot commented Dec 10, 2025

Walkthrough

Modified TaskSearchService.stringIdQuery() to handle null or empty ID input by constructing an empty ProcessResourceId instead of using the provided ID, affecting ID equality comparison logic.

Changes

Cohort / File(s) Summary
Query behavior adjustment
application-engine/src/main/java/com/netgrif/application/engine/workflow/service/TaskSearchService.java
Updated stringIdQuery to construct an empty ProcessResourceId when the input ID is null or empty; otherwise, use the provided ID. This widens the equality predicate for cases where an absent ID matches an empty resource identifier.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~5 minutes

  • Single file modification with straightforward null/empty handling logic
  • No public API changes or complex control flow alterations
  • Simple equality comparison adjustment with no cross-component interactions

Pre-merge checks

❌ Failed checks (1 warning)
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.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title directly addresses the main change: fixing an error in TaskSearchService when stringId is an empty string, which matches the PR's core objective.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

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.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 0ba6fe9 and 6e8d864.

📒 Files selected for processing (1)
  • application-engine/src/main/java/com/netgrif/application/engine/workflow/service/TaskSearchService.java (1 hunks)
🧰 Additional context used
🧠 Learnings (4)
📓 Common learnings
Learnt from: machacjozef
Repo: netgrif/application-engine PR: 367
File: application-engine/src/main/resources/application.yaml:24-24
Timestamp: 2025-10-20T11:44:44.907Z
Learning: In the netgrif/application-engine project, the correction of the Elasticsearch task index name from "_taks" to "_task" in application.yaml was approved by maintainer machacjozef, indicating that any data migration concerns for this typo fix are handled separately or not applicable to their deployment scenario.
Learnt from: Retoocs
Repo: netgrif/application-engine PR: 373
File: nae-spring-core-adapter/src/main/java/com/netgrif/application/engine/adapter/spring/actions/ActionApi.java:113-121
Timestamp: 2025-12-04T08:21:16.144Z
Learning: In ActionApiImpl, the processIdentifier parameter in searchTasks() is intentionally unused because it's required by the ActionApi interface for plugin implementations. This implementation returns tasks from all processes without filtering by processIdentifier, matching the behavior of searchCases().
Learnt from: renczesstefan
Repo: netgrif/application-engine PR: 339
File: application-engine/src/test/groovy/com/netgrif/application/engine/filters/FilterImportExportTest.groovy:341-341
Timestamp: 2025-08-19T20:07:15.621Z
Learning: In the Elasticsearch migration, the stringId property was removed from ElasticCase and ElasticTask, with the id property now containing the MongoDB case/task object ID directly. This consolidation eliminates redundancy and simplifies the data model.
Learnt from: renczesstefan
Repo: netgrif/application-engine PR: 339
File: application-engine/src/main/java/com/netgrif/application/engine/elastic/service/ElasticTaskQueueManager.java:38-45
Timestamp: 2025-08-20T07:27:02.660Z
Learning: When reviewing ElasticTaskQueueManager changes, task.getTask().getId() returns the document identifier while task.getTaskId() returns the business task identifier. The queue operations should use consistent identifiers throughout the lifecycle (scheduling, processing, cleanup).
Learnt from: renczesstefan
Repo: netgrif/application-engine PR: 373
File: application-engine/src/main/java/com/netgrif/application/engine/actions/ActionApiImpl.java:105-107
Timestamp: 2025-10-20T11:46:37.958Z
Learning: In ActionApiImpl, the processIdentifier parameter in searchCases() is intentionally unused because it's required by the ActionApi interface for plugin implementations. This implementation returns cases from all processes without filtering by processIdentifier.
📚 Learning: 2025-08-19T20:07:15.621Z
Learnt from: renczesstefan
Repo: netgrif/application-engine PR: 339
File: application-engine/src/test/groovy/com/netgrif/application/engine/filters/FilterImportExportTest.groovy:341-341
Timestamp: 2025-08-19T20:07:15.621Z
Learning: In the Elasticsearch migration, the stringId property was removed from ElasticCase and ElasticTask, with the id property now containing the MongoDB case/task object ID directly. This consolidation eliminates redundancy and simplifies the data model.

Applied to files:

  • application-engine/src/main/java/com/netgrif/application/engine/workflow/service/TaskSearchService.java
📚 Learning: 2025-12-04T08:21:16.144Z
Learnt from: Retoocs
Repo: netgrif/application-engine PR: 373
File: nae-spring-core-adapter/src/main/java/com/netgrif/application/engine/adapter/spring/actions/ActionApi.java:113-121
Timestamp: 2025-12-04T08:21:16.144Z
Learning: In ActionApiImpl, the processIdentifier parameter in searchTasks() is intentionally unused because it's required by the ActionApi interface for plugin implementations. This implementation returns tasks from all processes without filtering by processIdentifier, matching the behavior of searchCases().

Applied to files:

  • application-engine/src/main/java/com/netgrif/application/engine/workflow/service/TaskSearchService.java
📚 Learning: 2025-08-20T07:27:02.660Z
Learnt from: renczesstefan
Repo: netgrif/application-engine PR: 339
File: application-engine/src/main/java/com/netgrif/application/engine/elastic/service/ElasticTaskQueueManager.java:38-45
Timestamp: 2025-08-20T07:27:02.660Z
Learning: When reviewing ElasticTaskQueueManager changes, task.getTask().getId() returns the document identifier while task.getTaskId() returns the business task identifier. The queue operations should use consistent identifiers throughout the lifecycle (scheduling, processing, cleanup).

Applied to files:

  • application-engine/src/main/java/com/netgrif/application/engine/workflow/service/TaskSearchService.java
⏰ 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: Test

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix A change that fixes a bug Extra Small

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants