Skip to content

Conversation

@harshneyy
Copy link
Contributor

This PR fixes issue #5224.

Problem

On a fresh login, refreshing the page after navigating to a new tab (like "Environments") results in a blank screen. This is caused by the projectID not being persisted to localStorage because the utility function incorrectly treats an empty string as a falsy value.

Solution

I have updated the setUserDetails function in userDetails.ts to explicitly check for null or undefined. This ensures that a projectID (even if it's an empty string) is correctly saved to localStorage, preventing the redirect on page refresh.

Screenshots

Before Fix (Blank Screen on Refresh):
Screenshot from 2025-10-17 16-31-17

After Fix (Page Renders Correctly on Refresh):
Screenshot from 2025-10-17 16-37-59

Proposed changes

My PR fixes the blank screen issue by updating the setUserDetails utility function to correctly persist the projectID to localStorage

Types of changes

What types of changes does your code introduce to Litmus? Put an x in the boxes that apply

  • New feature (non-breaking change which adds functionality)
  • [ x] Bugfix (non-breaking change which fixes an issue)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation Update (if none of the other choices applies)

Checklist

Put an x in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.

  • [ x] I have read the CONTRIBUTING doc
  • [ x] I have signed the commit for DCO to be passed.
  • Lint and unit tests pass locally with my changes
  • I have added tests that prove my fix is effective or that my feature works (if appropriate)
  • I have added necessary documentation (if appropriate)

Dependency

  • Please add the links to the dependent PR need to be merged before this (if any).

Special notes for your reviewer:

@harshneyy harshneyy force-pushed the fix/portal-blank-page-5224 branch 3 times, most recently from caa2e59 to 10d43c7 Compare October 23, 2025 16:32
@harshneyy
Copy link
Contributor Author

Hi maintainers (@PriteshKiri, @SahilKr24, @amityt),

I'm having trouble getting the frontend-checks CI job to pass and could use some guidance.

My local environment uses Node v20, and yarn install completes successfully. I initially pushed changes generated with this setup.

The frontend-checks failed. Looking at the CI logs for that job, it seems to be using Node v16 (as specified in .github/workflows/push.yml).

When I switched my local environment to Node v16 and tried a clean yarn install, it failed because the pretty-format dependency requires Node >=18.

Since yarn install doesn't work locally with Node 16 but does with Node 20, I've switched back to Node 20, performed a clean install, and pushed the resulting yarn.lock.

Could the Node version specified (node-version: 16) in the push.yml workflow for frontend-checks be outdated compared to the project's current dependencies, which seem to require Node 18+? Any advice on how to proceed would be appreciated! Thanks.

@harshneyy harshneyy force-pushed the fix/portal-blank-page-5224 branch 5 times, most recently from 3a9a514 to 0cd79b9 Compare October 30, 2025 23:07
@harshneyy
Copy link
Contributor Author

harshneyy commented Oct 30, 2025

Hi maintainers (@SarthakJain26
, @SahilKr24, @amityt),

I've pushed an update that fixes the frontend-checks (linting) error and updates the build.yml Node.js version (as the dependencies require Node 18+).

The CI is now failing at the web-unit-tests step with a large number of TypeScript errors (like TS2322: Property 'size' does not exist on type 'IconProps'). This seems to be a project-wide issue caused by the @harnessio/icons component's props changing.

Since this seems like a larger, separate refactoring task, I've reverted all my attempts to fix those unit test errors. My branch now only contains the original bug fix, the CI/lint fixes, and the yarn.lock file generated with Node 20.

Could you please advise on how to proceed? Thank you!

@PriteshKiri
Copy link
Contributor

Hey @harshneyy

The team is currently working on fixing the build pipeline. We’ll keep this PR on hold for now and update you once it’s resolved.

@PriteshKiri
Copy link
Contributor

Hey @harshneyy

Could you please resolve the conflicts?

@PriteshKiri
Copy link
Contributor

Hey @harshneyy

Are you still working on this issue?

@harshneyy
Copy link
Contributor Author

@PriteshKiri ...oh sorry I was busy these days with placements....i will try to finish this issue by end of the day or by tomorrow for sure

@harshneyy
Copy link
Contributor Author

I mentioned in pr that I faced some difficulties while working on this....so i asked like how to proceed further.....so anyone could tell me how to proceed I may try it again
@PriteshKiri

@PriteshKiri
Copy link
Contributor

Sure @amitbhatt818 @SarthakJain26 could you please look into this?

@PriteshKiri
Copy link
Contributor

Meanwhile @harshneyy could you please resolve the conflicts?

@harshneyy
Copy link
Contributor Author

I think i have already done that..but i was facing difficulty in passing the checks then ,I reached out in slack as well that time but i got no response till now > Meanwhile @harshneyy could you please resolve the conflicts?

1 similar comment
@harshneyy
Copy link
Contributor Author

I think i have already done that..but i was facing difficulty in passing the checks then ,I reached out in slack as well that time but i got no response till now > Meanwhile @harshneyy could you please resolve the conflicts?

Copy link
Contributor

@amityt amityt left a comment

Choose a reason for hiding this comment

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

I see that few changes were not required as the part of this PR. The main logic is there in the userDetails.ts files. @harshneyy Can you please update the changes or rebase with the master branch properly. Thank You!

- uses: actions/setup-node@v4
with:
node-version: 16
node-version: 20
Copy link
Contributor

Choose a reason for hiding this comment

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

Hi @harshneyy why is this version upgrade needed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hi @harshneyy why is this version upgrade needed?

I updated this because the CI frontend-checks were failing on Node 16. The project dependencies (specifically packages like pretty-format) seem to require Node 18+ now. yarn install was failing during the build. However, if the team has fixed the pipeline separately, I will revert this change to keep the PR focused.

- uses: actions/setup-node@v4
with:
node-version: 16
node-version: 20
Copy link
Contributor

Choose a reason for hiding this comment

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

Same here.

Comment on lines 41 to 63
'/api': {
pathRewrite: { '^/api': '' },
target: process.env.CHAOS_MANAGER
? process.env.CHAOS_MANAGER
: targetLocalHost
? 'http://localhost:8080'
: `${baseUrl}/api`,
secure: false,
changeOrigin: true,
logLevel: 'info'
},
'/auth': {
pathRewrite: { '^/auth': '' },
target: process.env.CHAOS_MANAGER
? process.env.CHAOS_MANAGER
: targetLocalHost
? 'http://localhost:3000'
: `${baseUrl}/auth`,
secure: false,
changeOrigin: true,
logLevel: 'info'
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

This is just formatting change. Can you update the prettiers with the UI configuration?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is just formatting change. Can you update the prettiers with the UI configuration?

Apologies, this was an unintended change caused by my local Prettier configuration. I will revert this file completely to match master

@harshneyy
Copy link
Contributor Author

I see that few changes were not required as the part of this PR. The main logic is there in the userDetails.ts files. @harshneyy Can you please update the changes or rebase with the master branch properly. Thank You!

Hi @amityt, thanks for the review! You are right—the core logic is only in userDetails.ts. The other changes (Node version and formatting) happened because I was trying to get the CI pipeline to pass, as yarn install was failing on the older Node version. I will clean up the PR, revert the unnecessary files, and rebase immediately

@harshneyy harshneyy closed this Dec 12, 2025
@harshneyy harshneyy force-pushed the fix/portal-blank-page-5224 branch from 0cd79b9 to 82bb460 Compare December 12, 2025 14:59
Signed-off-by: Harshit Verma <harshitverma576@gmail.com>
@harshneyy harshneyy reopened this Dec 12, 2025
Signed-off-by: Harshit Verma <harshitverma576@gmail.com>
@harshneyy
Copy link
Contributor Author

Hi @amityt,

I have successfully cleaned up the PR.

I reverted the changes to webpack.dev.js and build.yml as requested.

The PR now contains only the logic fix in userDetails.ts.

Please note: The CI checks might fail again because I removed the Node.js version upgrade (v16 -> v20) from build.yml. It seems the project dependencies require a newer Node version to install correctly.

Ready for your review!

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants