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

[Bug]: 404 Resources not found Error When Accessing GitHub Branch #20883

Closed
1 task done
ame-appsmith opened this issue Feb 22, 2023 · 5 comments · Fixed by #21894
Closed
1 task done

[Bug]: 404 Resources not found Error When Accessing GitHub Branch #20883

ame-appsmith opened this issue Feb 22, 2023 · 5 comments · Fixed by #21894
Assignees
Labels
Bug Something isn't working Git Platform Issues related to the git & the app platform Git Product Issues related to version control product Medium Issues that frustrate users due to poor UX Needs Triaging Needs attention from maintainers to triage

Comments

@ame-appsmith
Copy link

ame-appsmith commented Feb 22, 2023

Is there an existing issue for this?

  • I have searched the existing issues

Description

A user created a new GitHub branch, made some additions there, then could not access the branch, getting a 404 Resources not found error. They tried to create a new branch and re-do the changes, after which they received an 404 error again. However, a new branch with no modifications is accessible and works fine.
For more info, check the screen recording of the bug from the Front thread.

Steps To Reproduce

  1. In an app that is connected to Git and has 3 pages (page Give appropriate error when method is invalid in cURL command #1 is the home page), create a new GitHub branch from master.
  2. In the new branch, set page Fix embedded datasource path #2 as home page, then delete page Give appropriate error when method is invalid in cURL command #1.
  3. Commit the changes.
  4. Leave the workspace.
  5. Re-access the app in edit mode, then try to access the new branch created in step Give appropriate error when method is invalid in cURL command #1.
    You will get the error 404 Resources not found.

Public Sample App

No response

Issue video log

No response

Version

Appsmith self-hosted

Front logo Front conversations

@ame-appsmith ame-appsmith added Bug Something isn't working Needs Triaging Needs attention from maintainers to triage Git Product Issues related to version control product Git Platform Issues related to the git & the app platform labels Feb 22, 2023
@AnaghHegde
Copy link
Member

Mom with @nayan-rafiq

  1. Behaviour of the product should not change. Example, 404 should be thrown when the page is not accessible

  2. When a user is switching the branch the user is interested in accessing the resources inside the branch and not is a specific page or any other resources per se

  3. The existing API has support for accepting the applicationId and branchName and we can use this to fix the behaviour reported in the bug

  4. We should have a discussion with someone from FE to make this change happen on the switch branch CTA.

cc - @infinitetrooper

@infinitetrooper
Copy link
Contributor

@AnaghHegde - Is the way forward to redirect to the homepage when the branch is switched if the active page is not presented in the checked-out branch?

As you mentioned that user is looking for resources in a branch and is not necessarily on the same page across branches.

@AnaghHegde
Copy link
Member

@infinitetrooper We have to redirect the user to the default page of the chosen branch. It can be the same page or a different page.

@infinitetrooper
Copy link
Contributor

infinitetrooper commented Mar 21, 2023

@infinitetrooper We have to redirect the user to the default page of the chosen branch. It can be the same page or a different page.

@AnaghHegde
If the same page exists in both branches, the user will still be on the same page when switching between branches right? We redirect the user to the default/homepage only if the page the user is on is deleted in the chosen branch.

@AnaghHegde
Copy link
Member

@infinitetrooper Yes, that is correct. I believe it should be possible. This has a FE dependency and I can confirm after talking to someone from the team.

@Nikhil-Nandagopal Nikhil-Nandagopal added the Medium Issues that frustrate users due to poor UX label Mar 21, 2023
hetunandu added a commit that referenced this issue Apr 4, 2023
## Description

After checkout, we will now check if the resource the user was accessing
is available in the incoming branch. Instead of calling the apis to
check this, we will listen to the success action and then handle check
if the current resource is still available in the branch. If not, we
will navigate the user to the home page of the app so that they do not
see a 404 error


> Don't show a 404 error when a resource is not available in the checked
out branch, instead take them to the home page of the app

Fixes #17234
Fixes #20883


Media



## Type of change

- Bug fix (non-breaking change which fixes an issue)


## How Has This Been Tested?

- Manual
   - Have a git connected app
   - Create a new branch 
   - Create a new API/Query/Page on the new branch
   - Switch back to the original branch
- Test: The app should not show 404 error but be navigated to the home
page of the app

- Cypress
Updated the existing cypress tests that avoided the error to make sure
they test the fix instead

### Test Plan
> Add Testsmith test cases links that relate to this PR

### Issues raised during DP testing
> Link issues raised during DP testing for better visiblity and tracking
(copy link from comments dropped on this PR)


## Checklist:
### Dev activity
- [ ] My code follows the style guidelines of this project
- [ ] I have performed a self-review of my own code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation
- [ ] My changes generate no new warnings
- [ ] I have added tests that prove my fix is effective or that my
feature works
- [ ] New and existing unit tests pass locally with my changes
- [ ] PR is being merged under a feature flag


### QA activity:
- [ ] Test plan has been approved by relevant developers
- [ ] Test plan has been peer reviewed by QA
- [ ] Cypress test cases have been added and approved by either SDET or
manual QA
- [ ] Organized project review call with relevant stakeholders after
Round 1/2 of QA
- [ ] Added Test Plan Approved label after reveiwing all Cypress test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working Git Platform Issues related to the git & the app platform Git Product Issues related to version control product Medium Issues that frustrate users due to poor UX Needs Triaging Needs attention from maintainers to triage
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants