Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: fix issue with forking #35988

Merged
merged 10 commits into from
Sep 5, 2024
Merged

fix: fix issue with forking #35988

merged 10 commits into from
Sep 5, 2024

Conversation

brayn003
Copy link
Contributor

@brayn003 brayn003 commented Aug 29, 2024

Description

Fix issue with forking

Fixes #35835

Automation

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

🔍 Cypress test results

Tip

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


Thu, 05 Sep 2024 08:15:19 UTC

Communication

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

  • Yes
  • No

Summary by CodeRabbit

  • New Features

    • Enhanced the Editor component to better track page transitions, improving performance and user experience.
  • Bug Fixes

    • Streamlined logic for handling page ID changes to prevent unnecessary re-initialization of the editor when navigating back to the default page.

@brayn003 brayn003 self-assigned this Aug 29, 2024
Copy link
Contributor

coderabbitai bot commented Aug 29, 2024

Walkthrough

The changes involve modifications to the fetchAppAndPagesSaga function and the Editor component. The saga's request object construction is simplified using the spread operator, while the Editor component now tracks the previous page ID more effectively, improving page transition handling. These updates aim to enhance the overall functionality and performance of the application.

Changes

Files Change Summary
app/client/src/ce/sagas/ApplicationSagas.tsx Simplified construction of the request object in fetchAppAndPagesSaga using the spread operator.
app/client/src/pages/Editor/index.tsx Added prevPageId property to the Editor class; updated logic in componentDidUpdate to track page ID changes more accurately.

Assessment against linked issues

Objective Addressed Explanation
Fork application without a 400 - Bad request error (35835) It's unclear if the changes directly resolve the issue.

🎉 In the code we trust, with changes so bright,
The saga now flows, the editor takes flight.
With pages that dance and transitions so smooth,
We celebrate progress, in every groove! 🌟


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

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>.
    • Generate unit testing code for this file.
    • 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 generate unit testing code for this file.
    • @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 generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @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.

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 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 Artifact Platform Product Issues related to the application platform Bug Something isn't working Critical This issue needs immediate attention. Drop everything else Cross Referencing Resources Issues part of the default resources tech debt initiative Fork App Issues related to forking apps Git Platform Pod Issues related to the git & the app platform Needs Triaging Needs attention from maintainers to triage Production QA Needs QA attention QA Pod Issues under the QA Pod Regressed Scenarios that were working before but have now regressed labels Aug 29, 2024
@brayn003 brayn003 requested review from rahulbarwal and removed request for ayushpahwa August 29, 2024 17:59
@brayn003 brayn003 added the ok-to-test Required label for CI label Aug 29, 2024
Copy link
Contributor

@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.yaml
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 67de8c1 and da839fe.

Files selected for processing (2)
  • app/client/src/ce/sagas/ApplicationSagas.tsx (1 hunks)
  • app/client/src/pages/Editor/index.tsx (4 hunks)
Additional context used
Learnings (2)
Common learnings
Learnt from: ankitakinger
PR: appsmithorg/appsmith#29965
File: app/client/src/ce/sagas/ApplicationSagas.tsx:736-742
Timestamp: 2024-01-03T09:53:22.824Z
Learning: The use of `editorId` instead of `appId` is an intentional change in the PR and is part of reverting to a previous functionality.
app/client/src/ce/sagas/ApplicationSagas.tsx (1)
Learnt from: ankitakinger
PR: appsmithorg/appsmith#29965
File: app/client/src/ce/sagas/ApplicationSagas.tsx:736-742
Timestamp: 2024-01-03T09:53:22.824Z
Learning: The use of `editorId` instead of `appId` is an intentional change in the PR and is part of reverting to a previous functionality.
Biome
app/client/src/pages/Editor/index.tsx

[error] 125-125: Avoid redundant double-negation.

It is not necessary to use double-negation when a value will already be coerced to a boolean.
Unsafe fix: Remove redundant double-negation

(lint/complexity/noExtraBooleanCast)

Additional comments not posted (4)
app/client/src/pages/Editor/index.tsx (3)

80-81: Good job adding prevPageId property.

This property will help in tracking the previous page ID effectively.


116-128: Nice improvement in componentDidUpdate method.

Caching prevPageId and checking for page ID updates enhances the component's ability to track page transitions.

Tools
Biome

[error] 125-125: Avoid redundant double-negation.

It is not necessary to use double-negation when a value will already be coerced to a boolean.
Unsafe fix: Remove redundant double-negation

(lint/complexity/noExtraBooleanCast)


Line range hint 129-162: Well done on streamlining the conditional block.

The logic now effectively prevents unnecessary re-initialization of the editor when navigating back to the default page.

app/client/src/ce/sagas/ApplicationSagas.tsx (1)

237-237: Great use of the spread operator.

The spread operator simplifies the construction of the request object and makes the code more concise.

app/client/src/pages/Editor/index.tsx Outdated Show resolved Hide resolved
@sagar-qa007
Copy link
Contributor

@brayn003 Should we consider updating an existing test case or adding a new one for unit testing?
Your insights would be appreciated.

@brayn003
Copy link
Contributor Author

brayn003 commented Aug 30, 2024

@sagar-qa007 think we need to add new test cases for this. I will pick this up as a separate task

Copy link
Contributor

@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: 0

Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

Commits

Files that changed from the base of the PR and between da839fe and 6975416.

Files selected for processing (1)
  • app/client/src/pages/Editor/index.tsx (4 hunks)
Additional context used
Learnings (1)
Common learnings
Learnt from: ankitakinger
PR: appsmithorg/appsmith#29965
File: app/client/src/ce/sagas/ApplicationSagas.tsx:736-742
Timestamp: 2024-01-03T09:53:22.824Z
Learning: The use of `editorId` instead of `appId` is an intentional change in the PR and is part of reverting to a previous functionality.
Biome
app/client/src/pages/Editor/index.tsx

[error] 125-125: Avoid redundant double-negation.

It is not necessary to use double-negation when a value will already be coerced to a boolean.
Unsafe fix: Remove redundant double-negation

(lint/complexity/noExtraBooleanCast)

Additional comments not posted (4)
app/client/src/pages/Editor/index.tsx (4)

80-80: Looks good!

The new prevPageId property will help track page transitions more effectively.


117-123: Great improvement!

The updated logic for determining page ID changes is more accurate and reliable. It takes into account the prevPageId and compares it with the current page ID derived from the basePageId values in the props.


125-127: Good thinking!

Caching the prevPageId value in the Editor class property is a smart move. It will be useful in future lifecycle methods to accurately determine if the page has changed.

Tools
Biome

[error] 125-125: Avoid redundant double-negation.

It is not necessary to use double-negation when a value will already be coerced to a boolean.
Unsafe fix: Remove redundant double-negation

(lint/complexity/noExtraBooleanCast)


161-164: Nice simplification!

The conditional block that updates the current page and sets up the page has been streamlined. It now checks if both pageId and prevPageId are defined and if the page ID has been updated. This prevents unnecessary re-initialization of the editor when navigating back to the default page.

Copy link
Contributor

@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: 0

Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 6975416 and 7f87f09.

Files selected for processing (1)
  • app/client/src/pages/Editor/index.tsx (4 hunks)
Files skipped from review as they are similar to previous changes (1)
  • app/client/src/pages/Editor/index.tsx
Additional context used
Learnings (1)
Common learnings
Learnt from: ankitakinger
PR: appsmithorg/appsmith#29965
File: app/client/src/ce/sagas/ApplicationSagas.tsx:736-742
Timestamp: 2024-01-03T09:53:22.824Z
Learning: The use of `editorId` instead of `appId` is an intentional change in the PR and is part of reverting to a previous functionality.

@brayn003 brayn003 merged commit 578f2d4 into release Sep 5, 2024
82 checks passed
@brayn003 brayn003 deleted the fix/fork-issue branch September 5, 2024 15:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Artifact Platform Product Issues related to the application platform Bug Something isn't working Critical This issue needs immediate attention. Drop everything else Cross Referencing Resources Issues part of the default resources tech debt initiative Fork App Issues related to forking apps Git Platform Pod Issues related to the git & the app platform Needs Triaging Needs attention from maintainers to triage ok-to-test Required label for CI Production QA Pod Issues under the QA Pod QA Needs QA attention Regressed Scenarios that were working before but have now regressed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: 400 - Bad request error seen while forking apps from within the application
4 participants