Skip to content

Conversation

@muhammad-ali-pk
Copy link
Contributor

@muhammad-ali-pk muhammad-ali-pk commented Jul 1, 2025

Problem Statement

When a user clicks on Request New Page button, fills out details and submits the form, the request takes a lot of time because it has to:
1. Create a google copydoc
2. Re-fetch the entire tree (all the projects) to invalidate cache
3. Refresh the page

This wait time can be reduced by:
1. Eliminating the need to re-fetch the entire tree (by optimizing the flow of data)
2. Eliminating the need to refresh
3. Invalidating cache on the backend, after creating a new webpage

Done

  • Invalidate cache for corresponding repository after creating a new webpage, within create-page request
  • Add a new helper function to insert a webpage w.r.t. to it's parent, within the tree.
  • Update the tree after creating a new webpage, in realtime, without having to re-fetch the tree or reload the page.
  • Drive-by: Cleaned up routes

QA

QA steps

  • Check out this repo
  • Run the project
docker run -d -p 5432:5432 -e POSTGRES_PASSWORD=postgres postgres
docker run -d -p 6379:6379 redis

dotrun

In a different terminal, run

dotrun exec celery -A webapp.app.celery_app worker -B  --loglevel=DEBUG

In another terminal, run

yarn dev
  • Access the application on localhost:8104/app
  • Wait for the projects to load
  • Click on "Request new page" button
  • Fill out the form and hit submit (Make sure to have VPN on for searching owners and reviewers)
  • Make sure the new page is created, opened and reflected in the tree without reloading the page.

Fixes

@webteam-app
Copy link

@muhammad-ali-pk muhammad-ali-pk changed the title Cleanups [WD-23309] feat: optimize page creation flow for better performance Jul 1, 2025
@samhotep
Copy link
Member

samhotep commented Jul 4, 2025

Hey @muhammad-ali-pk the PR looks good, there's just a few issues I found:

  • on submitting the new page request the redirect shows a blank page with this error, but the page works when reloaded.
    image
  • when some of the sites trees are not populated e.g having only u.com generated, the tree view shows the loaded sites but the table view shows 0 for all tables
    image

@muhammad-ali-pk
Copy link
Contributor Author

@samhotep Thanks Sam. It's ready for another look.

Copy link
Member

@samhotep samhotep left a comment

Choose a reason for hiding this comment

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

LGTM!

@muhammad-ali-pk muhammad-ali-pk merged commit 18d344b into main Jul 9, 2025
8 of 9 checks passed
@muhammad-ali-pk muhammad-ali-pk deleted the cleanups branch July 9, 2025 06:37
@github-actions
Copy link

github-actions bot commented Sep 5, 2025

🎉 This PR is included in version 1.0.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants