Skip to content

fix: stop India Compliance Account URL from growing on refresh - #4983

Open
karm1000 wants to merge 1 commit into
resilient-tech:developfrom
karm1000:fix/ic-account-url-shell-prefix
Open

karm1000 wants to merge 1 commit into
resilient-tech:developfrom
karm1000:fix/ic-account-url-shell-prefix

Conversation

@karm1000

@karm1000 karm1000 commented Oct 6, 2026

Copy link
Copy Markdown
Member

Problem

Opening India Compliance Account shows "Page Not Found", and the URL grows on every refresh:

/desk/india-compliance-account/desk/gst-india/india-compliance-account/...

Cause

Frappe now puts the shell in page URLs (/desk/gst-india/india-compliance-account).
The page's Vue router still used a fixed base of /desk/india-compliance-account.
The URL no longer started with that base, so Vue treated the whole URL as its own
sub-path and added its base in front again.

Fix

Read the router base from the URL on screen: everything up to and including
india-compliance-account. If the page name isn't in the URL, fall back to the old base.

@karm1000
karm1000 requested a review from ljain112 October 6, 2026 09:00
@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 0 complexity

Metric Results
Complexity 0

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@coderabbitai

coderabbitai Bot commented Oct 6, 2026

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 125a652e-ac13-465b-98cd-797ace74394d
📥 Commits

Reviewing files that changed from the base of the PR and between 960e8a4 and 0379c6e.

📒 Files selected for processing (1)
  • india_compliance/public/js/india_compliance_account/india_compliance_account.bundle.js

Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 1 remain after this review.


📝 Walkthrough

Walkthrough

createRouter now derives the Vue history base from the current pathname prefix through this.pageName when the pathname contains that segment. Otherwise, it uses Frappe’s generated India Compliance Account route.

Priority: ➖ Normal

Merge Risk: ⚪ Minimal · up to 0379c

No specific merge-blocking issue is established by the supplied evidence. The change derives the history base from the current page path and retains its fallback.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the fix for the India Compliance Account URL growing on refresh.
Description check ✅ Passed The description explains the URL growth problem and the router-base change that addresses it.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 1…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

Comment @coderabbitai help to get the list of available commands.

@greptile-apps

greptile-apps Bot commented Oct 6, 2026 •

Copy link
Copy Markdown

RetriggerConfidence Score: 4/5

[Medium risk] Changes how the India Compliance page router builds its base path.

Do not merge until account navigation preserves the shell in which the retained page is reopened.

Findings

  1. P1 Router restores the old shell ▶

Reviews (1) · Last reviewed commit: "fix: stop India Compliance Account URL f..."

Comment on lines +29 to +31
: pathSegments.slice(0, pageIndex + 1).join("/");

const history = createWebHistory(base);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Router restores the old shell

If the account page first opens in GST India and is later reopened in another eligible shell, this history base still points to GST India. Frappe reuses the page and fires show again, but the show handler replaces only the child route on the retained Vue router. Navigating the account page then changes the address back to GST India instead of preserving the selected shell. Update the history base when the page opens under a different shell before merging.

Knowledge Base Used: Compliance user interface

Artifacts

Executable account-shell browser reproduction script

  • This authored Playwright script loads the checked-out page class and real Vue Router, then simulates a cached-page shell switch; it provides the exact executed reproduction.

Observed account-shell browser run output

  • The captured command output records both URLs, router bases, child routes, the passing assertion, and exit code 0; it confirms restoration of the old shell.

▶ Recording of the check

  • Chromium records the initial page opening at the GST India URL before the simulated shell switch; it establishes the router’s original base.

Poster frame for first opening in the GST India shell

  • The browser captured a poster frame during the initial opening; it accompanies the baseline recording.

▶ Recording of the check

  • Chromium records the reused page after its child route is replaced under a simulated new shell; the executed output confirms the URL returns to GST India.

Poster frame after the cached-page shell switch

  • The browser captured a poster frame after the simulated shell switch and route replacement; it accompanies the defect recording.

View artifacts

T-Rex Ran code and verified through T-Rex

This branch has not been deployed

No deployments
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.

1 participant