Skip to content

[PER-10679] Replace navigateLean with getWithChildren in the publish functionality - #1135

Merged
aasandei-vsp merged 1 commit into
mainfrom
PER-10679-replace-navigate-lean-publish
Sep 18, 2026
Merged

aasandei-vsp merged 1 commit into
mainfrom
PER-10679-replace-navigate-lean-publish

Conversation

@aasandei-vsp

@aasandei-vsp aasandei-vsp commented Aug 12, 2026 •

Copy link
Copy Markdown
Contributor

Warning

Do not merge before #1132 , this PR depends on the mappings from that specific PR
Depends on accessRole being on stela records and folders

Manual test cases

Publishing a folder ⭐

The happy path

  1. Right-click a folder that has never been published and choose Publish.
    • EXPECTED: A spinner, then a public link. No error toast.
  2. Copy the link and open it in a new tab.
    • EXPECTED: The published copy of that folder loads, with its contents.
  3. Check the link text itself.
    • EXPECTED: It contains a real archive number and folder link id — no undefined, no NaN, no empty segment between slashes. The archive segment should end in -0000.
  4. Click View on the web in the dialog.
    • EXPECTED: It navigates to the published folder, the same place the copied link went. This is a different code path from the link text, so check both.
  5. Open the Public area from the left menu.
    • EXPECTED: The published copy is there, with the same name as the source folder.

Publishing a second copy of the same folder

  1. Publish the same folder again.
    • EXPECTED: A link comes back, pointing at the newest copy rather than the one from the first publish. This is the case that depends on the timestamp mapping — without it the dialog would pick an arbitrary copy or none at all.
  2. Open the Public area.
    • EXPECTED: Two copies exist, and the link from step 1 opens the more recent one.

Publishing a folder that contains subfolders and images

  1. Publish a folder holding both subfolders and image records.
    • EXPECTED: A link comes back within a few seconds.
  2. Open the link.
    • EXPECTED: Subfolders and images are all present, thumbnails included.

Internet Archive

  1. With a folder published, use the Internet Archive action in the same dialog.
    • EXPECTED: The request is accepted. No error about a missing item.

Publishing a record — unchanged path

  1. Publish a single record (not a folder).
    • EXPECTED: A public link comes back and opens the record.
  2. Publish a record that is still processing, if you can catch one.(I couldn't catch one, maybe a bigger file?)
    • EXPECTED: The specific message Sorry, this record cannot be copied or published until processing completes. — not the new generic error.

Info sidebar dates for folders ⭐

(no sidebar code changed — this is the surface the timestamp mapping newly reaches)

  1. Before building this branch on dev, select a folder in the file list, open the info sidebar and write down its Created and Last modified values.
    • EXPECTED: Two dates, in whatever format the app shows today.
  2. On this branch build on dev, select the same folder and compare.
    • EXPECTED: The same two dates. Watch for three specific things: a value shifting by hours or a day, a time appearing where there used to be only a date, and a row going blank.
  3. Select a folder, wait about ten seconds without clicking anything, then look again.
    • EXPECTED: The dates do not change while you watch. The background refresh overwrites folder rows a few seconds after load, so this is where a mismatch between the two sources would surface.
  4. Select a record instead.
    • EXPECTED: Uploaded and Last modified are unchanged from before — records already took this path.
  5. Select a folder in the Shares workspace, and one in the Public area.
    • EXPECTED: Both show dates, with no blanks and no errors.

Folder rename and date edit

(folder edits round-trip through the same conversion)

  1. Rename a folder from the file list and wait for the save to finish.
    • EXPECTED: The new name shows on the row.
  2. Select the renamed folder and check the sidebar.
    • EXPECTED: Last modified reflects the edit you just made, rather than a stale or blank value.

Folder thumbnails and lists in gallery

(same conversion, no timestamp involvement — regression only)

  1. Open a folder in the gallery containing several subfolders that each hold different images.
    • EXPECTED: Each folder tile shows a thumbnail from its own contents. No two folders sharing an image, no permanently blank tiles.

Unlisted share preview

  1. Open an unlisted share link to a folder while logged out.
    • EXPECTED: The folder and its contents render, with thumbnails.
  2. Navigate into a subfolder and back out.
    • EXPECTED: Both levels show the right contents.

@aasandei-vsp
aasandei-vsp force-pushed the PER-10476-replace-navigate-min branch from bf77982 to 72c4bfc Compare August 12, 2026 08:51
@codecov

codecov Bot commented Aug 12, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 53.81%. Comparing base (b092303) to head (9c89a8a).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1135      +/-   ##
==========================================
+ Coverage   53.60%   53.81%   +0.20%     
==========================================
  Files         359      359              
  Lines       12383    12384       +1     
  Branches     2256     2256              
==========================================
+ Hits         6638     6664      +26     
+ Misses       5515     5488      -27     
- Partials      230      232       +2     

☔ 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.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the folder publishing flow to use the Stela-backed getWithChildren API instead of navigateLean, and extends the Stela→FolderVO conversion to include folder timestamps so the publish dialog can reliably select the most recently updated published copy.

Changes:

  • Map Stela createdAt/updatedAt onto FolderVO.createdDT/updatedDT for folders (including child folders).
  • Replace navigateLean(publicRoot) with getWithChildren([publicRoot]) in the publish folder polling flow.
  • Expand unit tests to cover timestamp mapping and folder publish selection/error behavior.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
src/app/shared/services/api/folder.repo.ts Adds createdDT/updatedDT mapping in Stela folder conversion.
src/app/shared/services/api/folder.repo.spec.ts Adds unit tests verifying timestamp mapping for folders and children.
src/app/file-browser/components/publish/publish.component.ts Switches publish polling from navigateLean to getWithChildren and adds generic error handling.
src/app/file-browser/components/publish/publish.component.spec.ts Updates mocks/tests for getWithChildren publish flow and adds coverage for selection and error handling.
Suppressed comments (1)

src/app/file-browser/components/publish/publish.component.ts:90

  • The polling loop picks latest as the most recently updated folder across all public folders, then only checks whether that one folder’s name matches. If some unrelated public folder has a newer updatedDT than the newly-copied folder, this will never select the published copy and will keep retrying until it falls back, producing an incorrect/unused link.
					const publicFolders: FolderVO[] = publicRootFull.ChildItemVOs.filter(
						(i) => i instanceof FolderVO,
					) as FolderVO[];
					const latest = maxBy(publicFolders, (folder) => folder.updatedDT);
					if (latest && latest.displayName === this.sourceItem.displayName) {

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/app/file-browser/components/publish/publish.component.spec.ts Outdated

@slifty slifty left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Two very very tiny points -- approving since they are really just cosmetic!

Comment thread src/app/file-browser/components/publish/publish.component.spec.ts Outdated
Comment thread src/app/file-browser/components/publish/publish.component.spec.ts Outdated
@aasandei-vsp
aasandei-vsp force-pushed the PER-10476-replace-navigate-min branch 2 times, most recently from 50d2476 to 25f05ef Compare August 21, 2026 10:55
@aasandei-vsp
aasandei-vsp force-pushed the PER-10679-replace-navigate-lean-publish branch 2 times, most recently from 01eddfb to f22d6d7 Compare August 21, 2026 11:30
@aasandei-vsp aasandei-vsp self-assigned this Aug 21, 2026
@aasandei-vsp aasandei-vsp added the QA This issue is ready for QA / user acceptance testing label Aug 21, 2026
@aasandei-vsp
aasandei-vsp force-pushed the PER-10679-replace-navigate-lean-publish branch from f22d6d7 to 476f085 Compare August 21, 2026 11:59
@aasandei-vsp
aasandei-vsp force-pushed the PER-10476-replace-navigate-min branch from 25f05ef to a35c76a Compare September 8, 2026 14:10
@aasandei-vsp
aasandei-vsp force-pushed the PER-10679-replace-navigate-lean-publish branch from 476f085 to 91d528a Compare September 8, 2026 14:20
@aasandei-vsp
aasandei-vsp force-pushed the PER-10476-replace-navigate-min branch from a35c76a to e06059a Compare September 17, 2026 14:28
@aasandei-vsp
aasandei-vsp force-pushed the PER-10679-replace-navigate-lean-publish branch 2 times, most recently from 72580ae to a02b7d2 Compare September 17, 2026 14:48
@aasandei-vsp
aasandei-vsp force-pushed the PER-10476-replace-navigate-min branch from e06059a to 9c30619 Compare September 18, 2026 08:42
Base automatically changed from PER-10476-replace-navigate-min to main September 18, 2026 08:44

@omnignorant omnignorant left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

UAT passed on dev — branch PER-10679-replace-navigate-lean-publish, Dev build and deploy #1646, tested in Chrome plus a separate signed-out profile for the share preview. The build previously on dev was #1645 on PER-10476-replace-navigate-min, so the before/after comparison is against this PR's own base branch rather than main.

8 of the 9 QA scenario groups pass, both starred ones included. Not tested: the Internet Archive action — an outbound third-party submission from dev was out of scope for this pass.

One observation for follow-up, not a finding against this PR: in the public gallery, any item with no Date captions as "Invalid Date NaN, NaN". It reproduces on a folder published before this branch was deployed, and dated records render correctly, so it looks like missing-date handling in the caption rather than the timestamp mapping here.

Full report with screenshots and a reproduce-it audit plan is in the UAT folder.

The publish dialog polls the public route in order to find the copy
that was just made. Now the polling will happen through getWithChildren.

Issue: PER-10679
@aasandei-vsp
aasandei-vsp force-pushed the PER-10679-replace-navigate-lean-publish branch from a02b7d2 to 9c89a8a Compare September 18, 2026 08:50
@aasandei-vsp
aasandei-vsp merged commit 8f4a06a into main Sep 18, 2026
15 checks passed
@aasandei-vsp
aasandei-vsp deleted the PER-10679-replace-navigate-lean-publish branch September 18, 2026 09:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

QA This issue is ready for QA / user acceptance testing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants