Skip to content

[PER-10476] Skip folder fetches for synthetic folders without a folderId#1087

Open
aasandei-vsp wants to merge 1 commit into
mainfrom
PER-10476-get-folder-extra-call-bug
Open

[PER-10476] Skip folder fetches for synthetic folders without a folderId#1087
aasandei-vsp wants to merge 1 commit into
mainfrom
PER-10476-get-folder-extra-call-bug

Conversation

@aasandei-vsp

@aasandei-vsp aasandei-vsp commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Opening /app/shares triggered GET /api/v2/folder?folderIds[]=undefined (500): the sidebar fetched the current folder to get its displayTime, but the Shares workspace is a synthetic FolderVO with no folderId. Guard the sidebar fetch so only folders with a real folderId are requested, and filter invalid ids in FolderRepo.getStelaFolders, skipping the request entirely when none remain.

This is just a small bug that I found, not the full story.

Issue: PER-10476
Subtask: PER-10676

Manual test cases — Shares page folderIds[]=undefined fix need

Setup: log in with an account that has items shared with it, open dev tools (Console + Network tabs).
EXPECTED: no GET /api/v2/folder?folderIds[]=undefined request and no "Handled unknown error" in the console at any point below.


Shares page load

  1. Navigate to /app/shares and filter the Network tab by v2/folder.
    • EXPECTED: no request containing folderIds[]=undefined is sent, no 500 response, and no "Handled unknown error" appears in the console.
  2. Look at the page content.
    • EXPECTED: the shared items list still loads and renders normally.

Sidebar on the Shares page

  1. With nothing selected on /app/shares, open the sidebar.
    • EXPECTED: the sidebar shows the Shares workspace info without triggering any folder request or console error.
  2. Click a shared folder in the list.
    • EXPECTED: the sidebar loads its full details (name, date, size) via a request with a real numeric id, e.g. folderIds[]=149939 — never undefined.
  3. Click a shared file in the list.
    • EXPECTED: the sidebar loads the record details normally, with no v2/folder request at all.

Regression — My Files

  1. Go to /app/private, open any folder, and leave nothing selected so the sidebar shows the current folder.
    • EXPECTED: the sidebar still shows the folder's date; if a fetch is needed it uses the folder's real id in folderIds[].
  2. Set a date on a folder via the sidebar, then clear it.
    • EXPECTED: saving and clearing still work; after clearing, the date field shows empty without console errors.

Regression — Apps page (also a synthetic root folder)

  1. Navigate to /app/apps with the Network tab filtered by v2/folder.
    • EXPECTED: no folderIds[]=undefined request and no "Handled unknown error" in the console.

Opening /app/shares triggered GET /api/v2/folder?folderIds[]=undefined
(500): the sidebar fetched the current folder to get its displayTime,
but the Shares workspace is a synthetic FolderVO with no folderId.
Guard the sidebar fetch so only folders with a real folderId are
requested, and filter invalid ids in FolderRepo.getStelaFolders,
skipping the request entirely when none remain.

Issue: PER-10476
@codecov

codecov Bot commented Jul 15, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 52.19%. Comparing base (0fdfe8f) to head (62363f9).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1087      +/-   ##
==========================================
+ Coverage   52.13%   52.19%   +0.06%     
==========================================
  Files         354      354              
  Lines       12085    12089       +4     
  Branches     2181     2182       +1     
==========================================
+ Hits         6300     6310      +10     
- Misses       5555     5556       +1     
+ Partials      230      223       -7     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@aasandei-vsp aasandei-vsp self-assigned this Jul 15, 2026
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