Skip to content

feat: updated toast messages for on page load actions#40726

Merged
sneha122 merged 1 commit intoreleasefrom
feat/run-behaviour-toast-message-updates
May 22, 2025
Merged

feat: updated toast messages for on page load actions#40726
sneha122 merged 1 commit intoreleasefrom
feat/run-behaviour-toast-message-updates

Conversation

@sneha122
Copy link
Contributor

@sneha122 sneha122 commented May 21, 2025

Description

This PR:

Steps To Reproduce

  1. Create Query1
  2. Create Table1
  3. Edit Query1 body to be -> SELECT * FROM public."users" LIMIT {{Query2.data.length}};
  4. Attach this query1 to table1 -> We should a toast message saying Query1 will execute automatically on page load
    Now add Query2 and see the toast message -> It says "Query1, Query2 will execute automatically on page load instead it should just be Query2 in the message

Ref: #40656 (comment)

Fixes #40720 #40471
or
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.Table"

🔍 Cypress test results

Tip

🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉
Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/15179938858
Commit: 141e275
Cypress dashboard.
Tags: @tag.Table
Spec:


Thu, 22 May 2025 08:31:09 UTC

Communication

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

  • Yes
  • No

Summary by CodeRabbit

  • Refactor
    • Improved how on-load executables are managed based on a feature flag, dynamically adjusting their run behavior and user messages.
  • Tests
    • Added new tests to verify correct messaging and behavior updates for executables under different feature flag conditions.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented May 21, 2025

Walkthrough

The implementation of updateExecutablesRunBehaviour in OnLoadExecutablesUtilCEImpl was refactored to conditionally handle run behavior and toast messages based on the release_reactive_actions_enabled feature flag. Unit tests were added to verify correct message generation and logic under different flag and executable state scenarios.

Changes

File(s) Change Summary
.../onload/internal/OnLoadExecutablesUtilCEImpl.java Refactored updateExecutablesRunBehaviour to dynamically select run behavior and messages based on feature flag.
.../onload/internal/OnLoadExecutablesUtilCEImplTest.java Added unit tests covering various flag states and run behavior transitions, verifying correct message output.

Sequence Diagram(s)

sequenceDiagram
    participant Caller
    participant OnLoadExecutablesUtilCEImpl
    participant FeatureFlagService
    participant ExecutableService

    Caller->>OnLoadExecutablesUtilCEImpl: updateExecutablesRunBehaviour(...)
    OnLoadExecutablesUtilCEImpl->>FeatureFlagService: isFlagEnabled('release_reactive_actions_enabled')
    FeatureFlagService-->>OnLoadExecutablesUtilCEImpl: true/false
    OnLoadExecutablesUtilCEImpl->>ExecutableService: fetch existing executables
    ExecutableService-->>OnLoadExecutablesUtilCEImpl: List<Executable>
    OnLoadExecutablesUtilCEImpl->>OnLoadExecutablesUtilCEImpl: Compute updates and messages based on flag
    OnLoadExecutablesUtilCEImpl->>ExecutableService: updateUnpublishedExecutable (for each to update)
    ExecutableService-->>OnLoadExecutablesUtilCEImpl: update result
    OnLoadExecutablesUtilCEImpl-->>Caller: Mono<Boolean>
Loading

Assessment against linked issues

Objective Addressed Explanation
Correct toast message shown when automatic flag is on (#40720)
Only newly on-load executables appear in message when flag is on (#40720)

Possibly related PRs

Suggested labels

Enhancement, Core Query Execution, IDE Product, IDE Pod, Query Widgets & IDE Pod, ok-to-test

Poem

In the land of queries, flags now rule the day,
Toasts speak the truth, in a feature-flagged way.
With tests to ensure, no message goes astray,
Reactive or manual, the code knows what to say.
🎉 On page load or automatic, let the right names display!

Note

⚡️ AI Code Reviews for VS Code, Cursor, Windsurf

CodeRabbit now has a plugin for VS Code, Cursor and Windsurf. This brings AI code reviews directly in the code editor. Each commit is reviewed immediately, finding bugs before the PR is raised. Seamless context handoff to your AI code agent ensures that you can easily incorporate review feedback.
Learn more here.


Note

⚡️ Faster reviews with caching

CodeRabbit now supports caching for code and dependencies, helping speed up reviews. This means quicker feedback, reduced wait times, and a smoother review experience overall. Cached data is encrypted and stored securely. This feature will be automatically enabled for all accounts on May 30th. To opt out, configure Review - Disable Cache at either the organization or repository level. If you prefer to disable all data retention across your organization, simply turn off the Data Retention setting under your Organization Settings.
Enjoy the performance boost—your workflow just got faster.


📜 Recent review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d64361e and 141e275.

📒 Files selected for processing (2)
  • app/server/appsmith-server/src/main/java/com/appsmith/server/onload/internal/OnLoadExecutablesUtilCEImpl.java (1 hunks)
  • app/server/appsmith-server/src/test/java/com/appsmith/server/onload/internal/OnLoadExecutablesUtilCEImplTest.java (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (2)
  • GitHub Check: server-spotless / spotless-check
  • GitHub Check: server-unit-tests / server-unit-tests
🔇 Additional comments (10)
app/server/appsmith-server/src/test/java/com/appsmith/server/onload/internal/OnLoadExecutablesUtilCEImplTest.java (6)

239-273: Well-structured test for reactive message verification when feature flag is enabled.

The test correctly validates that when the release_reactive_actions_enabled flag is true and an executable is turned on, the appropriate reactive message is shown to the user. The assertions verify both the presence of the executable name and the correct messaging format.


275-309: Clean test implementation for regular page load message when feature flag is disabled.

This test case properly complements the previous one by verifying the alternate message format when the feature flag is off. The structure follows the same arrange-act-assert pattern, making the tests consistent and easy to follow.


311-345: Appropriate test for the executable turn-off scenario.

The test ensures that when an executable that was previously set to run automatically is turned off, a proper notification message is shown to the user. This test is particularly important as it validates the correct handling of the OFF state transition.


347-399: Good test for the specific PR issue - showing only changed entities in toast messages.

This test directly addresses the issue mentioned in the PR objectives where toast messages were incorrectly showing multiple queries. The test verifies that only the entity that actually changes state appears in the message, which is the core fix for issue #40720.


401-456: Complete test coverage for multiple executable state changes.

This test handles the more complex scenario of multiple executables changing state simultaneously. It correctly verifies that separate messages are generated for each change, rather than combining them into a single message that could be confusing.


458-477: Edge case handling for empty executable collections.

Good coverage of the boundary case where no executables are present. This ensures the method behaves correctly when there's nothing to process, returning false and not attempting to generate messages or updates.

app/server/appsmith-server/src/main/java/com/appsmith/server/onload/internal/OnLoadExecutablesUtilCEImpl.java (4)

315-321: Effective feature flag integration for determining run behavior type.

The code now properly uses the release_reactive_actions_enabled feature flag to dynamically select between AUTOMATIC and ON_PAGE_LOAD run behaviors. This approach maintains backward compatibility while allowing for the new reactive functionality.


322-330: Flexible filtering of executables based on conditional run behavior.

This segment dynamically filters existing on-load executables based on the feature flag value, ensuring that the comparison uses the appropriate run behavior enum. This approach prevents code duplication while maintaining correct behavior in both feature flag states.


398-405: Clean conditional setting of run behavior based on feature flag.

The code sets the appropriate run behavior enum value based on the feature flag status. This ensures that executables are properly configured with either AUTOMATIC (for reactive behavior) or ON_PAGE_LOAD (for traditional behavior) as needed.


436-458: Properly implemented conditional toast message generation.

This section successfully implements the different message formats based on the feature flag state. The message for reactive mode mentions "will run automatically on page load or when a variable it depends on changes" while the traditional mode uses "will be executed automatically on page load". This directly addresses the PR objective to update toast messages following the introduction of automatic run behavior.

✨ Finishing Touches
  • 📝 Generate Docstrings

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@github-actions github-actions bot added Bug Something isn't working Integrations Pod General Issues related to the Integrations Pod that don't fit into other tags. Integrations Pod Integrations Product Issues related to a specific integration Needs Triaging Needs attention from maintainers to triage Query Widgets & IDE Pod All issues related to Query, JS, Eval, Widgets & IDE Enhancement New feature or request and removed Bug Something isn't working labels May 21, 2025
@sneha122 sneha122 added the ok-to-test Required label for CI label May 21, 2025
@sneha122
Copy link
Contributor Author

/build-deploy-preview skip-tests=true

@github-actions github-actions bot added the Bug Something isn't working label May 21, 2025
@github-actions
Copy link

Deploying Your Preview: https://github.com/appsmithorg/appsmith/actions/runs/15164339690.
Workflow: On demand build Docker image and deploy preview.
skip-tests: true.
env: ``.
PR: 40726.
recreate: .

@github-actions
Copy link

Deploy-Preview-URL: https://ce-40726.dp.appsmith.com

@github-actions github-actions bot removed the Bug Something isn't working label May 22, 2025
@sneha122 sneha122 added ok-to-test Required label for CI and removed ok-to-test Required label for CI labels May 22, 2025
@github-actions github-actions bot added the Bug Something isn't working label May 22, 2025
Copy link
Contributor

@NilanshBansal NilanshBansal left a comment

Choose a reason for hiding this comment

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

LGTM

@github-actions github-actions bot removed the Bug Something isn't working label May 22, 2025
@sneha122
Copy link
Contributor Author

Not merging the PR yet because EE equivalent PR has few server unit test cases failing

@sneha122 sneha122 merged commit dae6281 into release May 22, 2025
119 of 122 checks passed
@sneha122 sneha122 deleted the feat/run-behaviour-toast-message-updates branch May 22, 2025 10:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Enhancement New feature or request Integrations Pod General Issues related to the Integrations Pod that don't fit into other tags. Integrations Pod Integrations Product Issues related to a specific integration Needs Triaging Needs attention from maintainers to triage ok-to-test Required label for CI Query Widgets & IDE Pod All issues related to Query, JS, Eval, Widgets & IDE

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Incorrect toast message shown in case of automatic flag on

2 participants